;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (byte-code "\300\301!\210\300\302!\210\300\303!\210\300\304!\210\300\305!\210\306\307\310\311\312\313%\210\314\315\316\317\320DD\321\322\323\312\307&\210\314\324\316\317\325DD\326\312\307\322\327&\210\314\330\316\317\331DD\332\312\307\322\333&\210\314\334\316\317\335DD\336\312\307\322\337&\210\314\340\316\317\341DD\342\312\307\343\344\322\345& \210\314\346\316\317\347DD\350\312\307\322\317&\210\314\351\316\317\352DD\353\312\307\322\337&\210\314\354\316\317\355DD\356\312\307\322\357&\210\314\360\316\317\361DD\362\312\307\322\363&\207" [require cl-lib ido rx subr-x thingatpt custom-declare-group perspective-mode nil "Customization for Perspective mode" :group frames custom-declare-variable persp-initial-frame-name funcall function #[0 "\300\207" [#1="main"] 1 #1#] "Name used for the initial perspective when enabling `persp-mode'." :type string persp-show-modestring #[0 "\300\207" [t] 1] "Determines if the list of perspectives is shown in the modeline.\nIf the value is 'header, the list of perspectives is shown in the\nheader line instead." (choice (const :tag "Off" nil) (const :tag "Modeline" t) (const :tag "Header" 'header)) persp-modestring-dividers #[0 "\300\207" [("[" "]" "|")] 1] "Plist of strings used to create the string shown in the modeline.\nFirst string is the start of the modestring, second is the\nclosing of the mode string, and the last is the divider between\nperspectives." (list (string :tag "Open") (string :tag "Close") (string :tag "Divider")) persp-modestring-short #[0 "\300\207" [nil] 1] "When t, show a shortened modeline string.\nA shortened modeline string only displays the current perspective\ninstead of the full perspective list." boolean persp-mode-prefix-key #[0 "\300\207" ["x"] 1] "Prefix key to activate perspective-map." :set #[514 "\302\300!\203\203\302\301!\203 \203\303!\210\304\"\207" [persp-mode-map perspective-map boundp persp-mode-set-prefix-key set-default] 5 "\n\n(fn SYM VALUE)"] key-sequence persp-interactive-completion-function #[0 "\203\301\207\302\207" [ido-mode ido-completing-read completing-read] 1] "Function used by Perspective to interactively complete user input." persp-switch-wrap #[0 "\300\207" [t] 1] "Whether `persp-next' and `persp-prev' should wrap." persp-sort #[0 "\300\207" [name] 1] "What order to sort perspectives.\nIf 'name, then sort alphabetically.\nIf 'access, then sort by last time accessed (latest first).\nIf 'created, then sort by time created (latest first)." (choice (const :tag "By Name" name) (const :tag "By Time Accessed" access) (const :tag "By Time Created" created)) persp-state-default-file #[0 "\300\207" [nil] 1] "When non-nil, it provides a default argument for `persp-state-save` and `persp-state-load` to work with.\n\n`persp-state-save` overwrites this file without prompting, which\nmakes it easy to use in, e.g., `kill-emacs-hook` to automatically\nsave state when exiting Emacs." file] 10) #@215 Like `let', but for frame parameters. Temporariliy set frame parameters according to BINDINGS then eval BODY. After BODY is evaluated, frame parameters are reset to their original values. (fn BINDINGS &rest BODY) (defalias 'persp-let-frame-parameters '(macro . #[385 "\300\301\"\302\303\304\300\305\"\"B\306\307\310DEE\207" [mapcar #[257 "\211@\300\301@\"B\207" [frame-parameter nil] 5 "\n\n(fn BINDING)"] unwind-protect progn append #[257 "\300\301\302@DA@F\207" [set-frame-parameter nil quote] 5 "\n\n(fn BINDING)"] modify-frame-parameters nil quote] 9 (#$ . 3022)])) (byte-code "\300\301\302\303#\300\207" [function-put persp-let-frame-parameters lisp-indent-function 1] 4) #@70 compiler-macro for inlining `perspective-p'. (fn CL-WHOLE-ARG CL-X) (defalias 'perspective-p--cmacro #[514 "\300\301\302\303\211\211&\207" [cl--defsubst-expand (cl-x) (cl-block perspective-p (and (memq (type-of cl-x) cl-struct-perspective-tags) t)) nil] 9 (#$ . 3714)]) (put 'perspective-p 'compiler-macro 'perspective-p--cmacro) #@13 (fn CL-X) (defalias 'perspective-p #[257 "\301!>\205 \302\207" [cl-struct-perspective-tags type-of t] 3 (#$ . 4054)]) (byte-code "\300\301\302\303#\304\305\306\301#\207" [function-put perspective-p side-effect-free error-free put perspective cl-deftype-satisfies] 5) #@67 compiler-macro for inlining `persp-name'. (fn CL-WHOLE-ARG CL-X) (defalias 'persp-name--cmacro #[514 "\300\301\302\303\211\211&\207" [cl--defsubst-expand (cl-x) (cl-block persp-name (progn (or (perspective-p cl-x) (signal 'wrong-type-argument (list 'perspective cl-x))) (aref cl-x 1))) nil] 9 (#$ . 4332)]) (put 'persp-name 'compiler-macro 'persp-name--cmacro) #@61 Access slot "name" of `perspective' struct CL-X. (fn CL-X) (defalias 'persp-name #[257 "\301!>\204\302\303\304D\"\210\211\305H\207" [cl-struct-perspective-tags type-of signal wrong-type-argument perspective 1] 5 (#$ . 4703)]) (byte-code "\300\301\302\303#\300\207" [function-put persp-name side-effect-free t] 4) #@70 compiler-macro for inlining `persp-buffers'. (fn CL-WHOLE-ARG CL-X) (defalias 'persp-buffers--cmacro #[514 "\300\301\302\303\211\211&\207" [cl--defsubst-expand (cl-x) (cl-block persp-buffers (progn (or (perspective-p cl-x) (signal 'wrong-type-argument (list 'perspective cl-x))) (aref cl-x 2))) nil] 9 (#$ . 5028)]) (put 'persp-buffers 'compiler-macro 'persp-buffers--cmacro) #@64 Access slot "buffers" of `perspective' struct CL-X. (fn CL-X) (defalias 'persp-buffers #[257 "\301!>\204\302\303\304D\"\210\211\305H\207" [cl-struct-perspective-tags type-of signal wrong-type-argument perspective 2] 5 (#$ . 5414)]) (byte-code "\300\301\302\303#\300\207" [function-put persp-buffers side-effect-free t] 4) #@69 compiler-macro for inlining `persp-killed'. (fn CL-WHOLE-ARG CL-X) (defalias 'persp-killed--cmacro #[514 "\300\301\302\303\211\211&\207" [cl--defsubst-expand (cl-x) (cl-block persp-killed (progn (or (perspective-p cl-x) (signal 'wrong-type-argument (list 'perspective cl-x))) (aref cl-x 3))) nil] 9 (#$ . 5748)]) (put 'persp-killed 'compiler-macro 'persp-killed--cmacro) #@63 Access slot "killed" of `perspective' struct CL-X. (fn CL-X) (defalias 'persp-killed #[257 "\301!>\204\302\303\304D\"\210\211\305H\207" [cl-struct-perspective-tags type-of signal wrong-type-argument perspective 3] 5 (#$ . 6129)]) (byte-code "\300\301\302\303#\300\207" [function-put persp-killed side-effect-free t] 4) #@78 compiler-macro for inlining `persp-local-variables'. (fn CL-WHOLE-ARG CL-X) (defalias 'persp-local-variables--cmacro #[514 "\300\301\302\303\211\211&\207" [cl--defsubst-expand (cl-x) (cl-block persp-local-variables (progn (or (perspective-p cl-x) (signal 'wrong-type-argument (list 'perspective cl-x))) (aref cl-x 4))) nil] 9 (#$ . 6460)]) (put 'persp-local-variables 'compiler-macro 'persp-local-variables--cmacro) #@72 Access slot "local-variables" of `perspective' struct CL-X. (fn CL-X) (defalias 'persp-local-variables #[257 "\301!>\204\302\303\304D\"\210\211\305H\207" [cl-struct-perspective-tags type-of signal wrong-type-argument perspective 4] 5 (#$ . 6886)]) (byte-code "\300\301\302\303#\300\207" [function-put persp-local-variables side-effect-free t] 4) #@79 compiler-macro for inlining `persp-last-switch-time'. (fn CL-WHOLE-ARG CL-X) (defalias 'persp-last-switch-time--cmacro #[514 "\300\301\302\303\211\211&\207" [cl--defsubst-expand (cl-x) (cl-block persp-last-switch-time (progn (or (perspective-p cl-x) (signal 'wrong-type-argument (list 'perspective cl-x))) (aref cl-x 5))) nil] 9 (#$ . 7244)]) (put 'persp-last-switch-time 'compiler-macro 'persp-last-switch-time--cmacro) #@73 Access slot "last-switch-time" of `perspective' struct CL-X. (fn CL-X) (defalias 'persp-last-switch-time #[257 "\301!>\204\302\303\304D\"\210\211\305H\207" [cl-struct-perspective-tags type-of signal wrong-type-argument perspective 5] 5 (#$ . 7675)]) (byte-code "\300\301\302\303#\300\207" [function-put persp-last-switch-time side-effect-free t] 4) #@75 compiler-macro for inlining `persp-created-time'. (fn CL-WHOLE-ARG CL-X) (defalias 'persp-created-time--cmacro #[514 "\300\301\302\303\211\211&\207" [cl--defsubst-expand (cl-x) (cl-block persp-created-time (progn (or (perspective-p cl-x) (signal 'wrong-type-argument (list 'perspective cl-x))) (aref cl-x 6))) nil] 9 (#$ . 8036)]) (put 'persp-created-time 'compiler-macro 'persp-created-time--cmacro) #@69 Access slot "created-time" of `perspective' struct CL-X. (fn CL-X) (defalias 'persp-created-time #[257 "\301!>\204\302\303\304D\"\210\211\305H\207" [cl-struct-perspective-tags type-of signal wrong-type-argument perspective 6] 5 (#$ . 8447)]) (byte-code "\300\301\302\303#\300\207" [function-put persp-created-time side-effect-free t] 4) #@83 compiler-macro for inlining `persp-window-configuration'. (fn CL-WHOLE-ARG CL-X) (defalias 'persp-window-configuration--cmacro #[514 "\300\301\302\303\211\211&\207" [cl--defsubst-expand (cl-x) (cl-block persp-window-configuration (progn (or (perspective-p cl-x) (signal 'wrong-type-argument (list 'perspective cl-x))) (aref cl-x 7))) nil] 9 (#$ . 8796)]) (put 'persp-window-configuration 'compiler-macro 'persp-window-configuration--cmacro) #@77 Access slot "window-configuration" of `perspective' struct CL-X. (fn CL-X) (defalias 'persp-window-configuration #[257 "\301!>\204\302\303\304D\"\210\211\305H\207" [cl-struct-perspective-tags type-of signal wrong-type-argument perspective 7] 5 (#$ . 9247)]) (byte-code "\300\301\302\303#\300\207" [function-put persp-window-configuration side-effect-free t] 4) #@75 compiler-macro for inlining `persp-point-marker'. (fn CL-WHOLE-ARG CL-X) (defalias 'persp-point-marker--cmacro #[514 "\300\301\302\303\211\211&\207" [cl--defsubst-expand (cl-x) (cl-block persp-point-marker (progn (or (perspective-p cl-x) (signal 'wrong-type-argument (list 'perspective cl-x))) (aref cl-x 8))) nil] 9 (#$ . 9620)]) (put 'persp-point-marker 'compiler-macro 'persp-point-marker--cmacro) #@69 Access slot "point-marker" of `perspective' struct CL-X. (fn CL-X) (defalias 'persp-point-marker #[257 "\301!>\204\302\303\304D\"\210\211\305H\207" [cl-struct-perspective-tags type-of signal wrong-type-argument perspective 8] 5 (#$ . 10031)]) (byte-code "\300\301\302\303#\304\305\306\"\207" [function-put persp-point-marker side-effect-free t defalias copy-perspective copy-sequence] 4) #@182 compiler-macro for inlining `make-persp-internal'. (fn CL-WHOLE &cl-quote &key NAME BUFFERS KILLED LOCAL-VARIABLES LAST-SWITCH-TIME CREATED-TIME WINDOW-CONFIGURATION POINT-MARKER) (defalias 'make-persp-internal--cmacro #[385 "\300\301\"A@\300\302\"A@\300\303\"A@\300\304\"A@\300\305\"\206 \306A@\300\307\"\206+\310A@\300\311\"\2066\312A@\300\313\"\206A\314A@\211\203p\211@\315>\203X\211AA\262\202E\316\n>A@\203g\317\262\202E\320\321@\"\210\202E\210\322\323\324\317 \317        & \207" [plist-member :name :buffers :killed :local-variables :last-switch-time (nil (current-time)) :created-time (nil (current-time)) :window-configuration (nil (current-window-configuration)) :point-marker (nil (point-marker)) (:name :buffers :killed :local-variables :last-switch-time :created-time :window-configuration :point-marker :allow-other-keys) :allow-other-keys nil error "Keyword argument %s not one of (:name :buffers :killed :local-variables :last-switch-time :created-time :window-configuration :point-marker)" cl--defsubst-expand (name buffers killed local-variables last-switch-time created-time window-configuration point-marker) (cl-block make-persp-internal (record 'perspective name buffers killed local-variables last-switch-time created-time window-configuration point-marker))] 24 (#$ . 10432)]) (put 'make-persp-internal 'compiler-macro 'make-persp-internal--cmacro) #@159 Constructor for objects of type `perspective'. (fn &key NAME BUFFERS KILLED LOCAL-VARIABLES LAST-SWITCH-TIME CREATED-TIME WINDOW-CONFIGURATION POINT-MARKER) (defalias 'make-persp-internal #[128 "\300\301\"A@\300\302\"A@\300\303\"A@\300\304\"A@\300\305\"\206#\306\307 DA@\300\310\"\2061\306\307 DA@\300\311\"\206?\306\312 DA@\300\313\"\206M\306\314 DA@\211\203|\211@\315>\203d\211AA\262\202Q\316\n>A@\203s\306\262\202Q\317\320@\"\210\202Q\210\321\322        & \207" [plist-member :name :buffers :killed :local-variables :last-switch-time nil current-time :created-time :window-configuration current-window-configuration :point-marker point-marker (:name :buffers :killed :local-variables :last-switch-time :created-time :window-configuration :point-marker :allow-other-keys) :allow-other-keys error "Keyword argument %s not one of (:name :buffers :killed :local-variables :last-switch-time :created-time :window-configuration :point-marker)" record perspective] 19 (#$ . 11848)]) (cl-struct-define 'perspective nil 'cl-structure-object 'record nil '((cl-tag-slot) (name) (buffers) (killed) (local-variables) (last-switch-time (current-time)) (created-time (current-time)) (window-configuration (current-window-configuration)) (point-marker (point-marker))) 'cl-struct-perspective-tags 'perspective t) (defalias 'persp--make-ignore-buffer-rx #[0 "\203\301\302\303C\304\305\"\"!\207\306\207" [ido-ignore-buffers rx-to-string append or mapcar #[257 "\300D\207" [regexp] 3 "\n\n(fn RX)"] "$^"] 6]) #@58 Return a list of all buffers in the current perspective. (defalias 'persp-current-buffers '(macro . #[0 "\300\207" [(persp-buffers (persp-curr))] 1 (#$ . 13388)])) #@74 Return a list of names of all living buffers in the current perspective. (defalias 'persp-current-buffer-names #[0 "\302 \303 \304!>\204\305\306\307D\"\210\211\310H\262\311\211:\203I@\262\312!\203B\313!\311\314\315#)\266\203\204B\313!B\262A\262\202\211\237\207" [cl-struct-perspective-tags inhibit-changing-match-data persp--make-ignore-buffer-rx persp-curr type-of signal wrong-type-argument perspective 2 nil buffer-live-p buffer-name t string-match] 11 (#$ . 13558)]) #@58 Return T if BUF is in the current perspective. (fn BUF) (defalias 'persp-is-current-buffer #[257 "\211\301 \302!>\204\303\304\305D\"\210\211\306H\262>\207" [cl-struct-perspective-tags persp-curr type-of signal wrong-type-argument perspective 2] 7 (#$ . 14061)]) #@115 Return F if BUF is in the current perspective. Used for filtering in buffer display modes like ibuffer. (fn BUF) (defalias 'persp-buffer-filter #[257 "\300!?\207" [persp-is-current-buffer] 3 (#$ . 14337)]) #@75 Return the subset of BUFS which is in the current perspective. (fn BUFS) (defalias 'persp-buffer-list-filter #[257 "\211\300\211:\203 @\262\301\302!!\203B\262A\262\202\211\237\207" [nil persp-is-current-buffer get-buffer] 7 (#$ . 14551)]) #@58 Return T if NAME is a valid perspective name. (fn NAME) (defalias 'persp-valid-name-p #[257 "\211??\205\n\211\300\230?\207" [""] 3 (#$ . 14811)]) #@64 Operate on BODY when we are in a perspective. (fn &rest BODY) (defalias 'with-current-perspective '(macro . #[128 "\300\301BB\207" [when (persp-curr)] 4 (#$ . 14965)])) (byte-code "\300\301\302\303#\300\207" [function-put with-current-perspective lisp-indent-function 0] 4) #@42 Get the name of the current perspective. (defalias 'persp-current-name #[0 "\301 \302!>\204\303\304\305D\"\210\211\306H\207" [cl-struct-perspective-tags persp-curr type-of signal wrong-type-argument perspective 1] 5 (#$ . 15247)]) #@23 (fn &optional NAME) (defalias 'persp-scratch-buffer #[256 "\301 \206\211\211\232\302?\205\303\304\"P\207" [persp-initial-frame-name persp-current-name "*scratch*" format " (%s)"] 8 (#$ . 15489)]) (defalias 'persp-killed-p 'persp-killed "Return whether the perspective CL-X has been killed.") #@805 XXX: A nasty workaround for a strange timing bug which occurs if the Emacs server was started before Perspective initialized. For some reason, persp-delete-frame gets called multiple times in unexpected ways. To reproduce: (0) make sure server-start is called before persp-mode is turned on and comment out the use of persp-started-after-server-mode, (1) get a session going with a main frame, (2) switch perspectives a couple of times, (3) use emacsclient -c to edit a file in a new frame, (4) C-x 5 0 to kill that frame. This will cause an unintended perspective switch in the primary frame, and mark the previous perspective as deleted. There is also a note in the *Messages* buffer. TODO: It would be good to get to the bottom of this problem, rather than just paper over it. (defvar persp-started-after-server-mode nil (#$ . 15798)) #@93 A hook that's run before `persp-switch'. Run with the previous perspective as `persp-curr'. (defvar persp-before-switch-hook nil (#$ . 16666)) #@97 A hook that's run after `persp-switch'. Run with the newly created perspective as `persp-curr'. (defvar persp-switch-hook nil (#$ . 16815)) #@58 A hook that's run after `persp-mode' has been activated. (defvar persp-mode-hook nil (#$ . 16961)) #@113 A hook that's run after a perspective has been created. Run with the newly created perspective as `persp-curr'. (defvar persp-created-hook nil (#$ . 17067)) #@117 A hook that's run just before a perspective is destroyed. Run with the perspective to be destroyed as `persp-curr'. (defvar persp-killed-hook nil (#$ . 17231)) #@102 A hook that's run after a perspective has been activated. Run with the activated perspective active. (defvar persp-activated-hook nil (#$ . 17398)) #@55 A hook run immediately before renaming a perspective. (defvar persp-before-rename-hook nil (#$ . 17552)) #@54 A hook run immediately after renaming a perspective. (defvar persp-after-rename-hook nil (#$ . 17663)) #@59 A hook run immediately before saving persp state to disk. (defvar persp-state-before-save-hook nil (#$ . 17772)) #@58 A hook run immediately after saving persp state to disk. (defvar persp-state-after-save-hook nil (#$ . 17891)) #@62 A hook run immediately before loading persp state from disk. (defvar persp-state-before-load-hook nil (#$ . 18008)) #@61 A hook run immediately after loading persp state from disk. (defvar persp-state-after-load-hook nil (#$ . 18130)) #@30 Keymap for perspective-mode. (defvar persp-mode-map (make-sparse-keymap) (#$ . 18250)) #@33 Sub-keymap for perspective-mode (defvar perspective-map nil (#$ . 18343)) (byte-code "\303\302!\210\304 \302#\210\304\n\305\306#\210\304\n\307\310#\210\304\n\311\312#\210\304\n\313\314#\210\304\n\315\316#\210\304\n\317\320#\210\304\n\321\322#\210\304\n\323\324#\210\304\n\325\326#\210\304\n\327\326#\210\304\n\330\331#\210\304\n\332\331#\210\304\n \333#\210\304\n\334\335#\210\304\n\336\337#\210\304\n\340\341#\210\304\n\342\343#\210\304\n\344\345#\210\304\n\346\347#\210\304\n\350\351#\210\304\n\352\353#\210\304\n\354\355#\210\304\n\356\357#\210\304\n\360\361#\210\304\n\362\363#\210\304\n\364\365#\210\366\367!\203\331\370\371!\210\366\372!\203\331\372\n\342\373\344\374\346\375\350\376\352\377\354\201@\356\201A\360\201B\362\201C\364\201D&\210\303\207" [persp-mode-map persp-mode-prefix-key perspective-map define-prefix-command define-key "s" persp-switch "k" persp-remove-buffer "c" persp-kill "r" persp-rename "a" persp-add-buffer "A" persp-set-buffer "b" persp-switch-to-buffer "i" persp-import "n" persp-next [right] "p" persp-prev [left] persp-switch-last "" persp-state-save "\f" persp-state-load "`" persp-switch-by-number "1" #[0 "\300\301!\207" [persp-switch-by-number 1] 2 nil nil] "2" #[0 "\300\301!\207" [persp-switch-by-number 2] 2 nil nil] "3" #[0 "\300\301!\207" [persp-switch-by-number 3] 2 nil nil] "4" #[0 "\300\301!\207" [persp-switch-by-number 4] 2 nil nil] "5" #[0 "\300\301!\207" [persp-switch-by-number 5] 2 nil nil] "6" #[0 "\300\301!\207" [persp-switch-by-number 6] 2 nil nil] "7" #[0 "\300\301!\207" [persp-switch-by-number 7] 2 nil nil] "8" #[0 "\300\301!\207" [persp-switch-by-number 8] 2 nil nil] "9" #[0 "\300\301!\207" [persp-switch-by-number 9] 2 nil nil] "0" #[0 "\300\301!\207" [persp-switch-by-number 10] 2 nil nil] fboundp which-key-mode require which-key which-key-add-keymap-based-replacements "switch to 1" "switch to 2" "switch to 3" "switch to 4" "switch to 5" "switch to 6" "switch to 7" "switch to 8" "switch to 9" "switch to 10"] 22) #@920 Return a hash containing all perspectives in FRAME. FRAME defaults to the currently selected frame. The keys are the perspectives' names. The values are persp structs, with the fields NAME, WINDOW-CONFIGURATION, BUFFERS, KILLED, POINT-MARKER, and LOCAL-VARIABLES. NAME is the name of the perspective. WINDOW-CONFIGURATION is the configuration given by `current-window-configuration' last time the perspective was saved (if this isn't the current perspective, this is when the perspective was last active). BUFFERS is a list of buffer objects that are associated with this perspective. KILLED is non-nil if the perspective has been killed. POINT-MARKER is the point position in the active buffer. Otherwise, when multiple windows are visiting the same buffer, all but one of their points will be overwritten. LOCAL-VARIABLES is an alist from variable names to their perspective-local values. (fn &optional FRAME) (defalias 'perspectives-hash #[256 "\300\301\"\206 \302 \207" [frame-parameter persp--hash make-hash-table] 4 (#$ . 20343)]) (defalias 'persp-mode-guard #[0 "\301\300!\205?\205\302\303!\207" [persp-mode boundp persp-error "persp-mode is not active"] 2]) #@109 Get the current perspective in FRAME. FRAME defaults to the currently selected frame. (fn &optional FRAME) (defalias 'persp-curr #[256 "\300 \210\301\302\"\206\f\303 \207" [persp-mode-guard frame-parameter persp--curr make-persp-internal] 4 (#$ . 21530)]) #@113 Get the last active perspective in FRAME. FRAME defaults to the currently selected frame. (fn &optional FRAME) (defalias 'persp-last #[256 "\300\301\"\207" [frame-parameter persp--last] 4 (#$ . 21796)]) #@67 Set NEWKEY as the prefix key to activate persp-mode. (fn NEWKEY) (defalias 'persp-mode-set-prefix-key #[257 "\301\302\303#\210\304\302#\207" [persp-mode-map substitute-key-definition perspective-map nil define-key] 5 (#$ . 22007)]) #@107 Whether a perspective error should cause persp-mode to be disabled. Dynamically bound by `persp-protect'. (defvar persp-protected nil (#$ . 22250)) (custom-declare-face 'persp-selected-face '((t (:weight bold :foreground "Blue"))) "The face used to highlight the current perspective on the modeline.") #@131 Wrap BODY to disable persp-mode when it errors out. This prevents the persp-mode from completely breaking Emacs. (fn &rest BODY) (defalias 'persp-protect '(macro . #[128 "\301\302\303\304)B\305BBB\207" [persp-protected t condition-case err progn ((persp-error (message "Fatal persp-mode error: %S" err) (persp-mode -1)))] 5 (#$ . 22559)])) (byte-code "\300\301\302\303#\300\207" [function-put persp-protect lisp-indent-function 0] 4) #@202 Like `error', but mark it as a persp-specific error. Used along with `persp-protect' to ensure that persp-mode doesn't bring down Emacs. ARGS will be interpreted by `format-message'. (fn &rest ARGS) (defalias 'persp-error #[128 "\203 \301\302\303\304\"C\"\207\303\305\"\207" [persp-protected signal persp-error apply format error] 6 (#$ . 23003)]) #@54 Raise an error if PERSP has been killed. (fn PERSP) (defalias 'check-persp #[257 "\211\204\301\302!\207\303!\205#\301\304\305!>\204\306\307\310D\"\210\311H\"\207" [cl-struct-perspective-tags persp-error "Expected perspective, was nil" persp-killed-p "Using killed perspective `%s'" type-of signal wrong-type-argument perspective 1] 7 (#$ . 23363)]) #@302 Create a new perspective struct and put it in `perspectives-hash'. ARGS is a list of keyword arguments followed by an optional BODY. The keyword arguments set the fields of the perspective struct. If BODY is given, it is executed to set the window configuration for the perspective. (fn &rest ARGS) (defalias 'make-persp '(macro . #[128 "\300\301@!\203(\302\303\211W\203#\300\211A\262\242B\262\210\211T\262\202\n\266\202\304!\262\305\306\307BDC\310\311\312\313\205A\314B\315BBB\316BBBBB\207" [nil keywordp 2 0 reverse let persp make-persp-internal (with-current-perspective (setf (persp-local-variables persp) (persp-local-variables (persp-curr)))) (puthash (persp-name persp) persp (perspectives-hash)) with-perspective (persp-name persp) save-excursion ((run-hooks 'persp-created-hook)) (persp)] 10 (#$ . 23730)])) (byte-code "\300\301\302\303#\300\207" [function-put make-persp lisp-indent-function defun] 4) #@137 Save the current perspective state. Specifically, save the current window configuration and perspective-local variables to `persp-curr' (defalias 'persp-save #[0 "\301 \205i\301 \302!>\204\303\304\305D\"\210\211\211\306\307\310\301 \302!>\204,\303\304\305D\"\210\211\306H\262\"I\266\301 \302!>\204F\303\304\305D\"\210\211\211\311\312 I\266\301 \302!>\204_\303\304\305D\"\210\211\211\313\314 I\262\262\207" [cl-struct-perspective-tags persp-curr type-of signal wrong-type-argument perspective 4 mapcar #[257 "\211@\211JD\207" [] 4 "\n\n(fn C)"] 7 current-window-configuration 8 point-marker] 11 (#$ . 24672)]) #@398 Return a list of the names of all perspectives on the `selected-frame'. If `persp-sort' is 'name (the default), then return them sorted alphabetically. If `persp-sort' is 'access, then return them sorted by the last time the perspective was switched to, the current perspective being the first. If `persp-sort' is 'created, then return them in the order they were created, with the newest first. (defalias 'persp-names #[0 "\301 \302C\303\304\305\"\"\210\211\242\237\266\202\306\267\202/\307\310\311\"\312\"\207\310\311\307\313\"\"\207\310\311\307\314\"\"\207\302\207" [persp-sort perspectives-hash nil maphash make-closure #[514 "\300\300\242B\240\207" [V0] 5 "\n\n(fn --CL-VAR-- V)"] #s(hash-table size 3 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (name 23 access 31 created 39)) sort mapcar persp-name string< #[514 "\301\302!>\204\303\304\305D\"\210\306H\302!>\204#\303\304\305D\"\210\306H\"\207" [cl-struct-perspective-tags time-less-p type-of signal wrong-type-argument perspective 5] 8 "\n\n(fn A B)"] #[514 "\301\302!>\204\303\304\305D\"\210\306H\302!>\204#\303\304\305D\"\210\306H\"\207" [cl-struct-perspective-tags time-less-p type-of signal wrong-type-argument perspective 6] 8 "\n\n(fn A B)"]] 6 (#$ . 25312)]) #@112 Return a list of the perspective names for all frames. Excludes NOT-FRAME, if given. (fn &optional NOT-FRAME) (defalias 'persp-all-names #[256 "\300\301\302\303\304\"\305 \"\"\207" [cl-reduce cl-union mapcar make-closure #[257 "\211\300\232?\205\301 p\302\303#\216\304\305\"\210\306 )\266\202\207" [V0 selected-frame make-closure #[0 "\302\300!\203 \303\300\304\"\210\305\301!\205\301q\207" [V0 V1 frame-live-p select-frame norecord buffer-live-p] 3] select-frame norecord persp-names] 7 "\n\n(fn FRAME)"] frame-list] 7 (#$ . 26596)]) #@186 Prompt for the name of a perspective. DEFAULT is a default value for the prompt. REQUIRE-MATCH can take the same values as in `completing-read'. (fn &optional DEFAULT REQUIRE-MATCH) (defalias 'persp-prompt #[512 "\301\203 \302\303Q\202\304\305Q\306 \307\307\211&\207" [persp-interactive-completion-function "Perspective name" " (default " ")" "" ": " persp-names nil] 10 (#$ . 27148)]) #@86 Switch to the perspective given by NAME while evaluating BODY. (fn NAME &rest BODY) (defalias 'with-perspective '(macro . #[385 "\300 \301\302\303B\304B\305\301\306\307BBBB\310\306\311BBEE\312BBBD\207" [cl-gensym progn let ((with-current-perspective (persp-current-name))) ((last-persp-cache (persp-last))) unwind-protect persp-switch ('norecord) when ('norecord) ((set-frame-parameter nil 'persp--last last-persp-cache))] 13 (#$ . 27553)])) (byte-code "\300\301\302\303#\300\207" [function-put with-perspective lisp-indent-function 1] 4) #@172 Remove all windows, ensure the remaining one has no window parameters. This prevents the propagation of reserved window parameters like window-side creating perspectives. (defalias 'persp-reset-windows #[0 "\301\302 \210\3031\304 0\202\210\305\202\205\306 )\207" [ignore-window-parameters t delete-other-windows (error) split-window nil delete-window] 1 (#$ . 28109)]) #@152 Return a new perspective with name NAME. The new perspective will start with only an `initial-major-mode' buffer called "*scratch* (NAME)". (fn NAME) (defalias 'persp-new #[257 "\303\304\"\305 \2034\306!>\204\307\310\311D\"\210\211\211\312\305 \306!>\204,\307\310\311D\"\210\211\312H\262I\266\313\306!>\204D\307\310\311D\"\210\314H\315 #\210\305 \205S\316 \317 \320\321\"\216\322\306!>\204k\307\310\311D\"\210\314H\323\"\210\212\324\325!!\210 \210\n\203\202\nc\210\326 \210)\327\330!\210)\331\332\333#\266\207" [cl-struct-perspective-tags initial-major-mode initial-scratch-message make-persp-internal :name persp-curr type-of signal wrong-type-argument perspective 4 puthash 1 perspectives-hash persp-current-name persp-last make-closure #[0 "\300\205\301\300\302\"\207" [V0 persp-switch norecord] 3] persp-switch norecord switch-to-buffer persp-scratch-buffer persp-reset-windows run-hooks persp-created-hook set-frame-parameter nil persp--last] 10 (#$ . 28494)]) #@155 Raise BUFFERS to the top of the most-recently-selected list. Returns BUFFERS with all non-living buffers removed. See also `other-buffer'. (fn BUFFERS) (defalias 'persp-reactivate-buffers #[257 "\300!\301\211:\203%@\262\302!\203\211C\244\262\303!\210A\262\202\211\237\207" [reverse nil buffer-live-p switch-to-buffer] 6 (#$ . 29502)]) #@104 Set the local variables given in VARS. VARS should be an alist of variable names to values. (fn VARS) (defalias 'persp-set-local-variables #[257 "\211\211\205\211@\300\301\"\210A\266\202\202\207" [apply set] 6 (#$ . 29861)]) #@228 Intersperse a value into a list. Return a new list made from taking LIST and inserting INTERSPERSED-VAL between every pair of items. For example, (persp-intersperse '(1 2 3) 'a) gives '(1 a 2 a 3). (fn LIST INTERSPERSED-VAL) (defalias 'persp-intersperse #[514 "\300\301\302\303\"\304\305$!\207" [reverse cl-reduce make-closure #[514 "\203\n\211\300BB\207\211C\207" [V0] 5 "\n\n(fn LIST EL)"] :initial-value nil] 8 (#$ . 30100)]) (defconst persp-mode-line-map (byte-code "\300 \301\302\303#\210\207" [make-sparse-keymap define-key [mode-line down-mouse-1] persp-mode-line-click] 5)) (defconst persp-header-line-map (byte-code "\300 \301\302\303#\210\207" [make-sparse-keymap define-key [header-line down-mouse-1] persp-mode-line-click] 5)) #@101 Select the clicked perspective. EVENT is the click event triggering this function call. (fn EVENT) (defalias 'persp-mode-line-click #[257 "\300\301\302\303\304!!@\"!\210\305 \207" [persp-switch format "%s" posn-string event-start persp-update-modestring] 7 (#$ . 30855) "e"]) #@76 Return the string displayed in the modeline representing the perspectives. (defalias 'persp-mode-line #[0 "\300\301\302\"\207" [frame-parameter nil persp--modestring] 3 (#$ . 31139)]) #@107 Update the string to reflect the current perspectives. Has no effect when `persp-show-modestring' is nil. (defalias 'persp-update-modestring #[0 "\205- @C A@C\303 8\304\305\306\307\n\203\310 C\202'\311\312\313\314 \"\"##\266\203\207" [persp-show-modestring persp-modestring-dividers persp-modestring-short 2 set-frame-parameter nil persp--modestring append persp-current-name persp-intersperse mapcar persp-format-name persp-names] 12 (#$ . 31330)]) #@99 Format the perspective name given by NAME for display in the mode line or header line. (fn NAME) (defalias 'persp-format-name #[257 "\303\304\"\305 \232\203\306\307\310#\207\311\267\202'\306\312 \313\314%\207\306\312\n\313\315%\207\316\207" [persp-show-modestring persp-header-line-map persp-mode-line-map format "%s" persp-current-name propertize face persp-selected-face #s(hash-table size 2 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (header 23 t 31)) local-map mouse-face header-line-highlight mode-line-highlight nil] 8 (#$ . 31797)]) #@302 Return the name of the first perspective that begins with CHAR. Perspectives are sorted alphabetically. PREV can be the name of a perspective. If it's passed, this will try to return the perspective alphabetically after PREV. This is used for cycling between perspectives. (fn CHAR &optional PREV) (defalias 'persp-get-quick #[513 "\300\301 #\207" [persp-get-quick-helper persp-names] 6 (#$ . 32375)]) #@81 Helper for `persp-get-quick' using CHAR, PREV, and NAMES. (fn CHAR PREV NAMES) (defalias 'persp-get-quick-helper #[771 "\211\205?\211@\204\300!=\203\211\202=\211\232\2037A\2031\300A@!=\2031A@\202=\301!\202=\302A#\262\207" [string-to-char persp-get-quick persp-get-quick-helper] 8 (#$ . 32788)]) #@60 Switch to the perspective accessed before the current one. (defalias 'persp-switch-last #[0 "\301 \204 \302\303!\210\304\301 \305!>\204\306\307\310D\"\210\211\311H\262!\207" [cl-struct-perspective-tags persp-last persp-error "There is no last perspective" persp-switch type-of signal wrong-type-argument perspective 1] 6 (#$ . 33114) nil]) #@469 Switch to the perspective given by NAME. If it doesn't exist, create a new perspective and switch to that. Switching to a perspective means that all buffers associated with that perspective are reactivated (see `persp-reactivate-buffers'), the perspective's window configuration is restored, and the perspective's local variables are set. If NORECORD is non-nil, do not update the `persp-last-switch-time' for the switched perspective. (fn NAME &optional NORECORD) (defalias 'persp-switch #[513 "\301!\204%\302\303 \205\"\303 \304!>\204\305\306\307D\"\210\211\310H\262!\262\311 \2033\312 \232\2033\207\313\314 \"\315\316\317\311 #\210\211\204H\320!\262\204P\321\322!\210\323!\210\204s\304!>\204g\305\306\307D\"\210\211\211\324\325 I\266\321\326!\210\207" [cl-struct-perspective-tags persp-valid-name-p persp-prompt persp-last type-of signal wrong-type-argument perspective 1 persp-curr persp-current-name gethash perspectives-hash set-frame-parameter nil persp--last persp-new run-hooks persp-before-switch-hook persp-activate 5 current-time persp-switch-hook] 8 (#$ . 33468) "i"]) #@54 Switch to the perspective given by NUMBER. (fn NUM) (defalias 'persp-switch-by-number #[257 "\300 \211GX\203\301S8!\266\202'\302\303\211\304U\203#\305\202$\306$\266\307 \207" [persp-names persp-switch message "Perspective number %s not available, only %s exist%s" 1 "s" "" persp-update-modestring] 9 (#$ . 34588) "NSwitch to perspective number: "]) #@71 Activate the perspective given by the persp struct PERSP. (fn PERSP) (defalias 'persp-activate #[257 "\301!\210\302 \210\303\304\305#\210\306 \210\307\310!>\204 \311\312\313D\"\210\314H!\210\310!>\2044\311\312\313D\"\210\211\211\315\316\310!>\204H\311\312\313D\"\210\315H!I\266\317\310!>\204_\311\312\313D\"\210\320H!\210\321\310!>\204t\311\312\313D\"\210\322H!\203\217\310!>\204\212\311\312\313D\"\210\211\322Hb\210\323 \210\324\325!\207" [cl-struct-perspective-tags check-persp persp-save set-frame-parameter nil persp--curr persp-reset-windows persp-set-local-variables type-of signal wrong-type-argument perspective 4 2 persp-reactivate-buffers set-window-configuration 7 marker-position 8 persp-update-modestring run-hooks persp-activated-hook] 9 (#$ . 34957)]) #@203 Switch to the first perspective, alphabetically, that begins with CHAR. Sets `this-command' (and thus `last-command') to (persp-switch-quick . CHAR). See `persp-switch', `persp-get-quick'. (fn CHAR) (defalias 'persp-switch-quick #[257 ":\203@ =\203\302A\"\202\302! B\211\203#\303!\207\304\305\306!P!\207" [last-command this-command persp-get-quick persp-switch persp-error "No perspective name begins with " string] 6 (#$ . 35765) "c"]) #@44 Switch to next perspective (to the right). (defalias 'persp-next #[0 "\301 \302\303 \"\211\204\304 \207\211GSU\203\205%\305@!\207\305T8!\207" [persp-switch-wrap persp-names cl-position persp-current-name persp-find-some persp-switch] 5 (#$ . 36227) nil]) #@47 Switch to previous perspective (to the left). (defalias 'persp-prev #[0 "\301 \302\303 \"\211\204\304 \207\211\305U\203 \205&\306GS8!\207\306S8!\207" [persp-switch-wrap persp-names cl-position persp-current-name persp-find-some 0 persp-switch] 5 (#$ . 36499) nil]) #@434 Return the name of a valid perspective. This function tries to return the "most appropriate" perspective to switch to. It tries: * The perspective given by `persp-last'. * The "first" perspective, based on the ordering of persp-names. * The main perspective. * The first existing perspective, alphabetically. If none of these perspectives can be found, this function will create a new main perspective and return "main". (defalias 'persp-find-some #[0 "\302 \203\302 \303!>\204\304\305\306D\"\210\211\307H\207\310 G\307V\203&\310 @\207\311 \312 \"\2030 \207\313\312 !\314V\203=\310 @\207\315\316\317 \320\321 \322\323 \324\325 &\326 \203|\303!>\204`\304\305\306D\"\210\211\211\327\326 \303!>\204t\304\305\306D\"\210\211\327H\262I\266\330\303!>\204\214\304\305\306D\"\210\307H\312 #\210\326 \205\233\331 \302 \332\333\"\216\334\303!>\204\263\304\305\306D\"\210\307H\335\"\210\336\337!\210)\340\341\342#\266\211\262!\210 \207" [cl-struct-perspective-tags persp-initial-frame-name persp-last type-of signal wrong-type-argument perspective 1 persp-names gethash perspectives-hash hash-table-count 0 persp-activate make-persp-internal :name :buffers buffer-list :window-configuration current-window-configuration :point-marker point-marker persp-curr 4 puthash persp-current-name make-closure #[0 "\300\205\301\300\302\"\207" [V0 persp-switch norecord] 3] persp-switch norecord run-hooks persp-created-hook set-frame-parameter nil persp--last] 10 (#$ . 36781)]) #@113 Associate BUFFER with the current perspective. See also `persp-switch' and `persp-remove-buffer'. (fn BUFFER) (defalias 'persp-add-buffer #[257 "\301!\302!?\205(\303 \304!>\204\305\306\307D\"\210\211\211\310\310HBI\262\262\207" [cl-struct-perspective-tags get-buffer persp-is-current-buffer persp-curr type-of signal wrong-type-argument perspective 2] 9 (#$ . 38298) (byte-code "\301\302\303!)C\207" [read-buffer-function nil read-buffer "Add buffer to perspective: "] 2)]) #@100 Associate BUFFER-NAME with the current perspective and remove it from any other. (fn BUFFER-NAME) (defalias 'persp-set-buffer #[257 "\300!\203A\301!\210\302\211\303\300!!\262\203=\304 \205\305 \306 \307\310\"\216\311A\312\"\210\313!\210)\314\302\315#\266\302\262\202\f\266\302\207\316\317\"\207" [get-buffer persp-add-buffer nil persp-buffer-in-other-p persp-curr persp-current-name persp-last make-closure #[0 "\300\205\301\300\302\"\207" [V0 persp-switch norecord] 3] persp-switch norecord persp-remove-buffer set-frame-parameter persp--last message "buffer %s doesn't exist"] 9 (#$ . 38794) (byte-code "\301\302\303!)C\207" [read-buffer-function nil read-buffer "Set buffer to perspective: "] 2)]) #@215 Returns nil if BUFFER is only in the current perspective. Otherwise, returns (FRAME . NAME), the frame and name of another perspective that has the buffer. Prefers perspectives in the selected frame. (fn BUFFER) (defalias 'persp-buffer-in-other-p #[257 "\3002,\301\302 \303\"\304C:\203(\211@\240\210\305\306\307#\310\242!\"\210A\262\202 \266\3040\207" [--cl-block-persp-buffer-in-other-p-- sort frame-list #[514 "\211\300 =\207" [selected-frame] 4 "\n\n(fn FRAME1 FRAME2)"] nil maphash make-closure #[514 "\301\242\303 \232\2053\304!\n>\204\305\306\307D\"\210\211\310H\311\301\242!\304!\n>\204-\305\306\307D\"\210\211\310H\262\232?\205g\300\304!\n>\204G\305\306\307D\"\210\312H>\205g\313\314\301\242\304!\n>\204b\305\306\307D\"\210\310HB\"\207" [V0 V1 cl-struct-perspective-tags selected-frame type-of signal wrong-type-argument perspective 1 persp-curr 2 throw --cl-block-persp-buffer-in-other-p--] 9 "\n\n(fn --CL-VAR-- PERSP)"] perspectives-hash] 8 (#$ . 39524)]) #@97 Like `switch-to-buffer', but switches to another perspective if necessary. (fn BUFFER-OR-NAME) (defalias 'persp-switch-to-buffer #[257 "\300!\301!\203 \302!\207\303!\211\242\304 =\203\305A!\210\302!\207" [window-normalize-buffer-to-switch-to persp-is-current-buffer switch-to-buffer persp-buffer-in-other-p selected-frame persp-switch] 5 (#$ . 40530) (byte-code "\301\302\303!)C\207" [read-buffer-function nil read-buffer-to-switch "Switch to buffer: "] 2)]) #@113 Disassociate BUFFER with the current perspective. See also `persp-switch' and `persp-add-buffer'. (fn BUFFER) (defalias 'persp-remove-buffer #[257 "\211\205\301!\262\302!\203U\303!\204\304!\210\202U\305!\203Q\305!\211\203M\306!r\307\310\"\216\311@\312\"\210\313 \210*\210\305!=?\205H\211\266\202\202%\210\202U\313!\210\314 \315!>\204f\316\317\320D\"\210\211\211\321\322\314 \315!>\204|\316\317\320D\"\210\211\321H\262\"I\207" [cl-struct-perspective-tags get-buffer buffer-live-p persp-buffer-in-other-p kill-buffer get-buffer-window internal--before-with-selected-window make-closure #[0 "\301\300!\207" [V0 internal--after-with-selected-window] 2] select-window norecord bury-buffer persp-curr type-of signal wrong-type-argument perspective 2 remq] 12 (#$ . 41007) (byte-code "\301\302 \"C\207" [persp-interactive-completion-function "Remove buffer from perspective: " persp-current-buffer-names] 3)]) #@153 Kill the perspective given by NAME. Killing a perspective means that all buffers associated with that perspective and no others are killed. (fn NAME) (defalias 'persp-kill #[257 "\211\204 \302\303 \304\"\262\305 \205\303 \306 \307\310\"\216\311\312\"\210\313\314!\210\315\316\305 \317!>\2045\320\321\322D\"\210\211\323H\262\"\210\305 \317!>\204M\320\321\322D\"\210\211\211\324\304I\266)\325\326\327#\266\330\331 \"\210\332 \210\306 \203\235\211\306 \317!>\204|\320\321\322D\"\210\211\333H\262\232\203\235\325\326\327\334\335 \211A@\211\205\230\336\331 \")\266\202#\210\305 \203\251\211\303 \232\205\267\337\216\325\326\327\306 #\210\311\340 !)\207" [cl-struct-perspective-tags persp-sort persp-prompt persp-current-name t persp-curr persp-last make-closure #[0 "\300\205\301\300\302\"\207" [V0 persp-switch norecord] 3] persp-switch norecord run-hooks persp-killed-hook mapc persp-remove-buffer type-of signal wrong-type-argument perspective 2 3 set-frame-parameter nil persp--last remhash perspectives-hash persp-update-modestring 1 access persp-names gethash #[0 "\300\301\302\"\207" [modify-frame-parameters nil ((persp--last))] 3] persp-find-some] 10 (#$ . 41955) "i"]) #@52 Rename the current perspective to NAME. (fn NAME) (defalias 'persp-rename #[257 "\301!\204\n\302\303!\210\304\305 \"\203\302\306\"\207\307\310!\210\311 \311!\312!\211\203>\312!\2035\313!\266\202@r\211q\210\314!\210)\266\315\316 \305 \"\210\317\320 \305 #\210\320 \321!>\204`\322\323\324D\"\210\211\211\325I\266\326 \210\307\327!\207" [cl-struct-perspective-tags persp-valid-name-p persp-error "Invalid perspective name" gethash perspectives-hash "Perspective `%s' already exists" run-hooks persp-before-rename-hook persp-scratch-buffer get-buffer persp-add-buffer rename-buffer remhash persp-current-name puthash persp-curr type-of signal wrong-type-argument perspective 1 persp-update-modestring persp-after-rename-hook] 6 (#$ . 43170) "sNew name: "]) #@207 Returns the list of buffers for a perspective named NAME from any frame other than NOT-FRAME. This doesn't return the window configuration because those can't be copied across frames. (fn NAME NOT-FRAME) (defalias 'persp-all-get #[514 "\3012N\302 \211\205K\211@\211\232\204D\303 p\304\305#\216\306\307\"\210\310\311 \"\211\203@\312\301\313!>\204;\314\315\316D\"\210\317H\"\210\210)\266A\266\202\202\2620\207" [cl-struct-perspective-tags --cl-block-persp-all-get-- frame-list selected-frame make-closure #[0 "\302\300!\203 \303\300\304\"\210\305\301!\205\301q\207" [V0 V1 frame-live-p select-frame norecord buffer-live-p] 3] select-frame norecord gethash perspectives-hash throw type-of signal wrong-type-argument perspective 2] 13 (#$ . 43954)]) #@361 A replacement for the built-in `read-buffer', meant to be used with `read-buffer-function'. Return the name of the buffer selected, only selecting from buffers within the current perspective. PROMPT, DEF, and REQUIRE-MATCH documented in `read-buffer'. With a prefix arg, uses the old `read-buffer' instead. (fn PROMPT &optional DEF REQUIRE-MATCH PREDICATE) (defalias 'persp-read-buffer #[1025 "\3021;\303 \203\304$\2028\305 \303C\211\306\307#\240\210\306\310\"\216\311\312\242\313#\210\304$)\266\202)0\207\314\315\"\210\316\317!\207" [read-buffer-function current-prefix-arg (persp-error) nil read-buffer persp-complete-buffer make-closure #[0 "\303\304\301\242\"\210\300\211\207" [V0 V1 minibuffer-completion-table remove-hook minibuffer-setup-hook] 3] #[0 "\301\302\300\242\"\207" [V0 remove-hook minibuffer-setup-hook] 3] add-hook minibuffer-setup-hook t message "Fatal persp-mode error: %S" persp-mode -1] 11 (#$ . 44732)]) #@67 Perform completion on all buffers within the current perspective. (defalias 'persp-complete-buffer #[0 "\302\303\304 \305!>\204\306\307\310D\"\210\211\311H\262\"\312\313 \206 \314\315\316\"\317$\207" [cl-struct-perspective-tags minibuffer-completion-table mapcar buffer-name persp-curr type-of signal wrong-type-argument perspective 2 apply-partially completion-table-with-predicate internal-complete-buffer make-closure #[257 "\211:\203\n\211@\202 \211\300\235\207" [V0] 3 "\n\n(fn NAME)"] nil] 7 (#$ . 45692)]) #@170 Import a perspective named NAME from another frame. If DONT-SWITCH is non-nil or with prefix arg, don't switch to the new perspective. (fn NAME &optional DONT-SWITCH) (defalias 'persp-import #[513 "\3022\377\204\303\304\305 !\306\307$\262\310\311 \"\203)\312\313\314Q!\204)\315\302\306\"\210\316\305 \"\306\2048\317\320\"\210\321\322\323$\324 \203n\325! >\204R\326\327\330D\"\210\211\211\331\324 \325! >\204f\326\327\330D\"\210\211\331H\262I\266\332\325! >\204~\326\327\330D\"\210\333H\311 #\210\324 \205\215\334 \335 \336\337\"\216\340\325! >\204\245\326\327\330D\"\210\333H\341\"\210\212\342\306\211\211:\203\325@\262\343!\203\312\262\306\211\262\202\313\307\203\325A\262\202\261\266\203!\210\344 \210)\345\346!\210)\347\306\350#\266\211\262\262\203\371\351 \266\202\202\376\352!\266\2020\207" [persp-interactive-completion-function cl-struct-perspective-tags --cl-block-persp-import-- "Import perspective: " persp-all-names selected-frame nil t gethash perspectives-hash yes-or-no-p "Perspective `" "' already exits. Continue? " throw persp-all-get persp-error "Perspective `%s' doesn't exist in another frame" make-persp-internal :name :buffers persp-curr type-of signal wrong-type-argument perspective 4 puthash 1 persp-current-name persp-last make-closure #[0 "\300\205\301\300\302\"\207" [V0 persp-switch norecord] 3] persp-switch norecord switch-to-buffer buffer-live-p persp-reset-windows run-hooks persp-created-hook set-frame-parameter persp--last persp-update-modestring persp-activate] 14 (#$ . 46222) "i\nP"]) (byte-code "\300\301\302\303\304$\210\300\305\306\303\304$\210\300\307\310\303\304$\210\300\311\312\313\304$\210\300\314\315\313\304$\210\300\316\317\320\304$\210\321\322\323\324\325DD\326\327\330\331\332\333\334& \207" [ad-add-advice switch-to-buffer (persp-add-buffer-adv nil t (advice lambda nil "Add BUFFER to the current perspective.\n\nSee also `persp-add-buffer'." (persp-protect (let ((buf (ad-get-arg 0))) (when buf (persp-add-buffer buf)))))) after nil display-buffer (persp-add-buffer-adv nil t (advice lambda nil "Add BUFFER to the perspective for the frame on which it's displayed.\n\nSee also `persp-add-buffer'." (persp-protect (when ad-return-value (let ((buf (ad-get-arg 0)) (frame (window-frame ad-return-value))) (when (and buf frame) (with-selected-frame frame (persp-add-buffer buf)))))))) set-window-buffer (persp-add-buffer-adv nil t (advice lambda nil "Add BUFFER to the perspective for window's frame.\n\nSee also `persp-add-buffer'." (persp-protect (let ((buf (ad-get-arg 1)) (frame (window-frame (ad-get-arg 0)))) (when (and buf frame) (with-selected-frame frame (persp-add-buffer buf))))))) switch-to-prev-buffer (persp-ensure-buffer-in-persp nil t (advice lambda nil "Ensure that the selected buffer is in WINDOW's perspective." (let* ((window (window-normalize-window window t)) (frame (window-frame window)) (old-buffer (window-buffer window))) ad-do-it (let ((buffer (window-buffer window))) (with-selected-frame frame (unless (persp-is-current-buffer buffer) (let ((name (persp-scratch-buffer))) (when (and bury-or-kill (equal name (buffer-name old-buffer))) (setq name (persp-scratch-buffer))) (with-selected-window window (switch-to-buffer name) (funcall initial-major-mode))))))))) around recursive-edit (persp-preserve-for-recursive-edit nil t (advice lambda nil "Preserve the current perspective when entering a recursive edit." (persp-protect (persp-save) (persp-let-frame-parameters ((persp--recursive (persp-curr))) (let ((old-hash (copy-hash-table (perspectives-hash)))) ad-do-it (maphash (lambda (key new-persp) (let ((persp (gethash key old-hash))) (when persp (setf (persp-buffers persp) (persp-buffers new-persp))))) (perspectives-hash)) (set-frame-parameter nil 'persp--hash old-hash)))))) exit-recursive-edit (persp-restore-after-recursive-edit nil t (advice lambda nil "Restore the old perspective when exiting a recursive edit." (persp-protect (if (frame-parameter nil 'persp--recursive) (persp-switch (persp-name (frame-parameter nil 'persp--recursive))))))) before custom-declare-variable persp-mode funcall function #[0 "\300\207" [nil] 1] "Non-nil if Persp mode is enabled.\nSee the `persp-mode' command\nfor a description of this minor mode.\nSetting this variable directly does not take effect;\neither customize it (see the info node `Easy Customization')\nor call the function `persp-mode'." :set custom-set-minor-mode :initialize custom-initialize-default :type boolean] 10) #@696 Toggle perspective mode. When active, keeps track of multiple 'perspectives', named collections of buffers and window configurations. This is a minor mode. If called interactively, toggle the `Persp 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 'persp-mode)'. The mode's hook is called both when the mode is enabled and when it is disabled. (fn &optional ARG) (defalias 'persp-mode #[256 "\306 \307\301\310=\203\311\301!?\202!\247\203 \312W\203 \313\202!\314\"\210\315\300!\2038\316\301\"\311\301!\2038\301B \203\257\3171\242\315\302!\203L\n\203L\314\320\321!\210\320\322!\210\320\323!\210\320\324!\210\320\325!\210\320\326!\210\327\330\331\332#\210\333\334\335\"\210\333\336\337\"\210\333\340\341\"\210\342\343\335\344 \"\210\345 \346! >\204\222\347\350\351D\"\210\211\211\352\353 I\266\354\355!0\210\202\354\356\357\"\210\301\360!\266\202\354\361\330\332\"\210\362\363!\210\364\336\337\"\210\364\334\335\"\210\364\340\341\"\210\313\365\313\366\313#\210\367\370@\"@\307\371\367\3729\"\"\210\367\3739\"\204\354\307\371\313\"\210\354\355\311\301!\203\370\374\202\371\375\"\210\376\377!\203)\201A\301!\210\306 \203\211\306 \232\203)\356\201B\311\301!\203#\201C\202&\201D\373#\210\210\201E \210\311\301!\207" [global-minor-modes persp-mode server-process persp-started-after-server-mode read-buffer-function cl-struct-perspective-tags current-message set-default toggle default-value 1 nil t boundp delq (persp-error) ad-activate switch-to-buffer display-buffer set-window-buffer switch-to-prev-buffer recursive-edit exit-recursive-edit advice-add helm-buffer-list-1 :filter-return persp-buffer-list-filter add-hook after-make-frame-functions persp-init-frame delete-frame-functions persp-delete-frame ido-make-buffer-list-hook persp-set-ido-buffers persp-read-buffer mapc frame-list persp-curr type-of signal wrong-type-argument perspective 2 buffer-list run-hooks persp-mode-hook message "Fatal persp-mode error: %S" -1 advice-remove ad-deactivate-regexp "^persp-.*" remove-hook set-frame-parameter persp--hash delete (:eval (persp-mode-line)) header-line-format (:eval (persp-mode-line)) "" persp-mode-on-hook persp-mode-off-hook called-interactively-p any global-mode-string customize-mark-as-set "Persp mode %sabled%s" "en" "dis" force-mode-line-update] 7 (#$ . 50751) (byte-code "\203\n\301!\202 \302C\207" [current-prefix-arg prefix-numeric-value toggle] 2)]) (defvar persp-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" [persp-mode-map persp-mode-hook variable-documentation put "Hook run after entering or leaving `persp-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 persp-mode] 6) #@99 Initialize the perspectives system in FRAME. By default, this uses the current frame. (fn FRAME) (defalias 'persp-init-frame #[257 "\305 p\306\307#\216\310\311\"\210\312\313\"\210\314\315\316\317\320\321\322$#\210\203U\323=\203A\324\325!\206/\326\327\235\204=\330\325\331\332\"\"\210\210\202R \206F\333\334 \235\204R\331 \335\"\336 \210\337\340\"\203~\341\n! ;\203h \202x\342 !\203w \206x\211\202x\211\343\344\"\266\345\346\347\n\350pC\351\352 \353\354 &\355 \203\275\356!\f>\204\241\357\360\361D\"\210\211\211\362\355 \356!\f>\204\265\357\360\361D\"\210\211\362H\262I\266\363\356!\f>\204\315\357\360\361D\"\210\364H\365 #\210\355 \205\334\366 \367 \306\370\"\216\371\356!\f>\204\364\357\360\361D\"\210\364H\311\"\210\372\373!\210)\314\374\375#\266\211\262!)\207" [persp-show-modestring global-mode-string persp-initial-frame-name initial-buffer-choice cl-struct-perspective-tags selected-frame make-closure #[0 "\302\300!\203 \303\300\304\"\210\305\301!\205\301q\207" [V0 V1 frame-live-p select-frame norecord buffer-live-p] 3] select-frame norecord modify-frame-parameters ((persp--hash) (persp--curr) (persp--last) (persp--recursive) (persp--modestring)) set-frame-parameter persp--hash make-hash-table :test equal :size 10 header default-value header-line-format (#1="") (:eval (persp-mode-line)) set-default append ((:eval (persp-mode-line))) (#1#) (:eval (persp-mode-line)) ((:eval (persp-mode-line))) persp-update-modestring frame-parameter client persp-scratch-buffer functionp switch-to-buffer t persp-activate make-persp-internal :name :buffers :window-configuration current-window-configuration :point-marker point-marker persp-curr type-of signal wrong-type-argument perspective 4 puthash 1 perspectives-hash persp-current-name persp-last #[0 "\300\205\301\300\302\"\207" [V0 persp-switch norecord] 3] persp-switch run-hooks persp-created-hook nil persp--last] 13 (#$ . 53960)]) #@85 Clean up perspectives in FRAME. By default this uses the current frame. (fn FRAME) (defalias 'persp-delete-frame #[257 "\301 p\302\303#\216\304\305\"\210?\205\306\307\310 \")\207" [persp-started-after-server-mode selected-frame make-closure #[0 "\302\300!\203 \303\300\304\"\210\305\301!\205\301q\207" [V0 V1 frame-live-p select-frame norecord buffer-live-p] 3] select-frame norecord mapcar persp-kill persp-names] 7 (#$ . 55916)]) #@303 Make VARIABLE become perspective-local. This means that whenever a new perspective is switched into, the variable will take on its local value for that perspective. When a new perspective is created, the variable will inherit its value from the current perspective at time of creation. (fn VARIABLE) (defalias 'persp-make-variable-persp-local #[257 "\211\301 \302!>\204\303\304\305D\"\210\211\306H\262\236?\205=\211JD\307 \211\2059\211@\310\311\312\"\313!\"\210A\266\202\202\"\262\262\207" [cl-struct-perspective-tags persp-curr type-of signal wrong-type-argument perspective 4 frame-list maphash make-closure #[514 "\302! >\204\303\304\305D\"\210\211\211\306\300\306HBI\207" [V0 cl-struct-perspective-tags type-of signal wrong-type-argument perspective 4] 8 "\n\n(fn --CL-VAR-- PERSP)"] perspectives-hash] 8 (#$ . 56365)]) #@221 Add code that should be run to set up the perspective named NAME. Whenever a new perspective named NAME is created, runs BODY in it. In addition, if one exists already, runs BODY in it immediately. (fn NAME &rest BODY) (defalias 'persp-setup-for '(macro . #[385 "\300\301\302\303\304\305\306\307 EBBE\310BBB\305\311\312BB\313BBEE\207" [progn add-hook 'persp-created-hook lambda nil when string= (persp-current-name) ('append) gethash ((perspectives-hash)) with-perspective] 11 (#$ . 57218)])) (byte-code "\300\301\302\303#\300\207" [function-put persp-setup-for lisp-indent-function 1] 4) #@53 Restrict the ido buffer to the current perspective. (defalias 'persp-set-ido-buffers #[0 "\302\303\304\305\306 \307!>\204\310\311\312D\"\210\211\313H\262\"\"\314\315\316\" \303\317:\203>@\262\320#\210A\262\211T\262\202#\266\321\322 \"\323\324\"\"\211\207" [cl-struct-perspective-tags ido-temp-list remq nil mapcar buffer-name persp-curr type-of signal wrong-type-argument perspective 2 make-hash-table :test equal 0 puthash sort cl-intersection make-closure #[514 "\301\300\"\301\300\"W\207" [V0 gethash] 6 "\n\n(fn A B)"]] 9 (#$ . 57822)]) #@162 Bind quick key commands to switch to perspectives. All C-S-letter key combinations are bound to switch to the first perspective beginning with the given letter. (defalias 'quick-perspective-keys #[0 "\301\211\302X\203!\303\304\305\306!P!\307\310\311\312DF#\210\211T\262\202\310\207" [persp-mode-map 97 122 define-key read-kbd-macro "C-S-" string lambda nil (interactive) persp-switch-quick] 9 (#$ . 58394)]) #@40 Deactivate the perspective modestring. (defalias 'persp-turn-off-modestring #[0 "\301\302\303\302#\210\302\211\207" [persp-show-modestring set-frame-parameter nil persp--modestring] 4 (#$ . 58816) nil]) #@38 Activate the perspective modestring. (defalias 'persp-turn-on-modestring #[0 "\301\302 \207" [persp-show-modestring t persp-update-modestring] 1 (#$ . 59026) nil]) #@98 A version of `other-buffer' which respects perspectives. (fn &optional BUFFER VISIBLE-OK FRAME) (defalias 'persp-other-buffer #[768 "\301#\211\302 \303!>\204\304\305\306D\"\210\211\307H\262\235\203!\207\310\311 !\207" [cl-struct-perspective-tags other-buffer persp-curr type-of signal wrong-type-argument perspective 2 get-buffer-create persp-scratch-buffer] 10 (#$ . 59197)]) #@220 Like `switch-to-buffer', restricted to the current perspective. This respects ido-ignore-buffers, since we automatically add buffer filtering to ido-mode already (see use of PERSP-SET-IDO-BUFFERS). (fn BUFFER-OR-NAME) (defalias 'persp-switch-to-buffer* #[257 "\300!\301!\207" [window-normalize-buffer-to-switch-to switch-to-buffer] 4 (#$ . 59592) (byte-code "\204 \204\303\304\305!)\2024\306 \307\310 !\311\312\313\203%\312\314\"\202&\315\"\303\211\211\211\307\310 !&\266\202C\207" [current-prefix-arg persp-mode read-buffer-function nil read-buffer-to-switch "Switch to buffer" persp-current-buffer-names buffer-name persp-other-buffer completing-read format "Switch to buffer%s: " " (default %s)" ""] 11)]) #@215 Like `kill-buffer', restricted to the current perspective. This respects ido-ignore-buffers, since we automatically add buffer filtering to ido-mode already (see use of PERSP-SET-IDO-BUFFERS). (fn BUFFER-OR-NAME) (defalias 'persp-kill-buffer* #[257 "\300!\207" [kill-buffer] 3 (#$ . 60324) (byte-code "\204 \204\303\304\305p\")\202$\306\307\310\311p!\"\312 \303\211\211\211\311p!&C\207" [current-prefix-arg persp-mode read-buffer-function nil read-buffer "Kill buffer: " completing-read format "Kill buffer (default %s): " buffer-name persp-current-buffer-names] 9)]) #@88 Like the default C-x C-b, but filters for the current perspective's buffers. (fn ARG) (defalias 'persp-buffer-menu #[257 "\203'\211\204'\302\303\304\305\306\307 \310! >\204\311\312\313D\"\210\211\314H\262\"\"!\207\302\303 !\207" [persp-mode cl-struct-perspective-tags switch-to-buffer list-buffers-noselect nil seq-filter buffer-live-p persp-curr type-of signal wrong-type-argument perspective 2] 11 (#$ . 60908) "P"]) #@88 Like the default C-x C-b, but filters for the current perspective's buffers. (fn ARG) (defalias 'persp-list-buffers #[257 "\203'\211\204'\302\303\304\305\306\307 \310! >\204\311\312\313D\"\210\211\314H\262\"\"!\207\302\303 !\207" [persp-mode cl-struct-perspective-tags display-buffer list-buffers-noselect nil seq-filter buffer-live-p persp-curr type-of signal wrong-type-argument perspective 2] 11 (#$ . 61342) "P"]) #@259 Invoke BS-SHOW with a configuration enabled for Perspective. With a prefix arg, show buffers in all perspectives. This respects ido-ignore-buffers, since we automatically add buffer filtering to ido-mode already (see use of PERSP-SET-IDO-BUFFERS). (fn ARG) (defalias 'persp-bs-show #[257 "\302\303!\204\n\304\305!\210\306 \307\310\311\211\312BBBBC\313\311\211\314BBBBC# \2033\2043\315\310!\2026\315\313!)\207" [bs-configurations persp-mode featurep bs user-error "bs not loaded" persp--make-ignore-buffer-rx append "perspective" nil (persp-buffer-filter nil) "all-perspectives" (nil nil) bs--show-with-configuration] 10 (#$ . 61776) "P"]) #@259 Invoke IBUFFER with a configuration enabled for Perspective. With a prefix arg, show buffers in all perspectives. This respects ido-ignore-buffers, since we automatically add buffer filtering to ido-mode already (see use of PERSP-SET-IDO-BUFFERS). (fn ARG) (defalias 'persp-ibuffer #[257 "\303\304!\204\n\305\306!\210\203\211\204\307 \310C\n#\304 )\207\304 \207" [persp-mode ibuffer-maybe-show-predicates ido-ignore-buffers featurep ibuffer user-error "IBuffer not loaded" append persp-buffer-filter] 5 (#$ . 62433) "P"]) #@32 (fn ARG IVY-PARAMS FALLBACK) (defalias 'persp--switch-buffer-ivy-counsel-helper #[771 "\303\304!\204\n\305\306!\210\203N\204N\307\310\311\312\313\314 \"\315\316\317\320\321\322 \323 \324! >\2042\325\326\327D\"\210\211\330H\262\"\"\"\331\320\332p!!\333\n\334\335\336\337\340\341\257\f\"\"\207\211 \207" [persp-mode cl-struct-perspective-tags ivy-switch-buffer-map featurep ivy user-error "Ivy not loaded" apply ivy-read append format "Switch to buffer (%s): " persp-current-name cl-remove-if null mapcar buffer-name seq-intersection buffer-list persp-curr type-of signal wrong-type-argument perspective 2 :preselect persp-other-buffer :keymap :caller ivy-switch-buffer :action ivy--switch-buffer-action :matcher ivy--switch-buffer-matcher] 18 (#$ . 62969)]) #@73 A version of `ivy-switch-buffer' which respects perspectives. (fn ARG) (defalias 'persp-ivy-switch-buffer #[257 "\301K\302\303\304\"\216\203\204\301M\210\305\306\307#)\207" [persp-mode ivy--buffer-list #[769 "\300 \207" [persp-current-buffer-names] 4 "\n\n(fn STR &optional VIRTUAL PREDICATE)"] make-closure #[0 "\301\300M\207" [V0 ivy--buffer-list] 2] persp--switch-buffer-ivy-counsel-helper nil ivy-switch-buffer] 7 (#$ . 63744) "P"]) #@77 A version of `counsel-switch-buffer' which respects perspectives. (fn ARG) (defalias 'persp-counsel-switch-buffer #[257 "\300\301!\204\n\302\303!\210\304\305\306\307\310F\311#\207" [featurep counsel user-error "Counsel not loaded" persp--switch-buffer-ivy-counsel-helper :unwind counsel--switch-buffer-unwind :update-fn counsel--switch-buffer-update-fn counsel-switch-buffer] 7 (#$ . 64197) "P"]) #@80 compiler-macro for inlining `persp--state-complete-p'. (fn CL-WHOLE-ARG CL-X) (defalias 'persp--state-complete-p--cmacro #[514 "\300\301\302\303\211\211&\207" [cl--defsubst-expand (cl-x) (cl-block persp--state-complete-p (and (memq (type-of cl-x) cl-struct-persp--state-complete-tags) t)) nil] 9 (#$ . 64603)]) (put 'persp--state-complete-p 'compiler-macro 'persp--state-complete-p--cmacro) #@13 (fn CL-X) (defalias 'persp--state-complete-p #[257 "\301!>\205 \302\207" [cl-struct-persp--state-complete-tags type-of t] 3 (#$ . 65004)]) (byte-code "\300\301\302\303#\304\305\306\301#\207" [function-put persp--state-complete-p side-effect-free error-free put persp--state-complete cl-deftype-satisfies] 5) #@84 compiler-macro for inlining `persp--state-complete-files'. (fn CL-WHOLE-ARG CL-X) (defalias 'persp--state-complete-files--cmacro #[514 "\300\301\302\303\211\211&\207" [cl--defsubst-expand (cl-x) (cl-block persp--state-complete-files (progn (or (persp--state-complete-p cl-x) (signal 'wrong-type-argument (list 'persp--state-complete cl-x))) (aref cl-x 1))) nil] 9 (#$ . 65323)]) (put 'persp--state-complete-files 'compiler-macro 'persp--state-complete-files--cmacro) #@72 Access slot "files" of `persp--state-complete' struct CL-X. (fn CL-X) (defalias 'persp--state-complete-files #[257 "\301!>\204\302\303\304D\"\210\211\305H\207" [cl-struct-persp--state-complete-tags type-of signal wrong-type-argument persp--state-complete 1] 5 (#$ . 65800)]) (byte-code "\300\301\302\303#\300\207" [function-put persp--state-complete-files side-effect-free t] 4) #@85 compiler-macro for inlining `persp--state-complete-frames'. (fn CL-WHOLE-ARG CL-X) (defalias 'persp--state-complete-frames--cmacro #[514 "\300\301\302\303\211\211&\207" [cl--defsubst-expand (cl-x) (cl-block persp--state-complete-frames (progn (or (persp--state-complete-p cl-x) (signal 'wrong-type-argument (list 'persp--state-complete cl-x))) (aref cl-x 2))) nil] 9 (#$ . 66191)]) (put 'persp--state-complete-frames 'compiler-macro 'persp--state-complete-frames--cmacro) #@73 Access slot "frames" of `persp--state-complete' struct CL-X. (fn CL-X) (defalias 'persp--state-complete-frames #[257 "\301!>\204\302\303\304D\"\210\211\305H\207" [cl-struct-persp--state-complete-tags type-of signal wrong-type-argument persp--state-complete 2] 5 (#$ . 66673)]) (byte-code "\300\301\302\303#\304\305\306\"\207" [function-put persp--state-complete-frames side-effect-free t defalias copy-persp--state-complete copy-sequence] 4) #@102 compiler-macro for inlining `make-persp--state-complete'. (fn CL-WHOLE &cl-quote &key FILES FRAMES) (defalias 'make-persp--state-complete--cmacro #[385 "\300\301\"A@\300\302\"A@\211\2037\211@\303>\203 \211AA\262\202 \304>A@\203.\305\262\202 \306\307@\"\210\202 \210\310\311\312\305\305&\207" [plist-member :files :frames (:files :frames :allow-other-keys) :allow-other-keys nil error "Keyword argument %s not one of (:files :frames)" cl--defsubst-expand (files frames) (cl-block make-persp--state-complete (record 'persp--state-complete files frames))] 12 (#$ . 67128)]) (put 'make-persp--state-complete 'compiler-macro 'make-persp--state-complete--cmacro) #@82 Constructor for objects of type `persp--state-complete'. (fn &key FILES FRAMES) (defalias 'make-persp--state-complete #[128 "\300\301\"A@\300\302\"A@\211\2037\211@\303>\203 \211AA\262\202 \304>A@\203.\305\262\202 \306\307@\"\210\202 \210\310\311#\207" [plist-member :files :frames (:files :frames :allow-other-keys) :allow-other-keys nil error "Keyword argument %s not one of (:files :frames)" record persp--state-complete] 7 (#$ . 67812)]) (byte-code "\300\301\302\303#\304\305\306\307\310\306\311\312\305\303& \207" [function-put make-persp--state-complete side-effect-free t cl-struct-define persp--state-complete nil cl-structure-object record ((cl-tag-slot) (files) (frames)) cl-struct-persp--state-complete-tags] 11) #@77 compiler-macro for inlining `persp--state-frame-p'. (fn CL-WHOLE-ARG CL-X) (defalias 'persp--state-frame-p--cmacro #[514 "\300\301\302\303\211\211&\207" [cl--defsubst-expand (cl-x) (cl-block persp--state-frame-p (and (memq (type-of cl-x) cl-struct-persp--state-frame-tags) t)) nil] 9 (#$ . 68557)]) (put 'persp--state-frame-p 'compiler-macro 'persp--state-frame-p--cmacro) #@13 (fn CL-X) (defalias 'persp--state-frame-p #[257 "\301!>\205 \302\207" [cl-struct-persp--state-frame-tags type-of t] 3 (#$ . 68940)]) (byte-code "\300\301\302\303#\304\305\306\301#\207" [function-put persp--state-frame-p side-effect-free error-free put persp--state-frame cl-deftype-satisfies] 5) #@82 compiler-macro for inlining `persp--state-frame-persps'. (fn CL-WHOLE-ARG CL-X) (defalias 'persp--state-frame-persps--cmacro #[514 "\300\301\302\303\211\211&\207" [cl--defsubst-expand (cl-x) (cl-block persp--state-frame-persps (progn (or (persp--state-frame-p cl-x) (signal 'wrong-type-argument (list 'persp--state-frame cl-x))) (aref cl-x 1))) nil] 9 (#$ . 69247)]) (put 'persp--state-frame-persps 'compiler-macro 'persp--state-frame-persps--cmacro) #@70 Access slot "persps" of `persp--state-frame' struct CL-X. (fn CL-X) (defalias 'persp--state-frame-persps #[257 "\301!>\204\302\303\304D\"\210\211\305H\207" [cl-struct-persp--state-frame-tags type-of signal wrong-type-argument persp--state-frame 1] 5 (#$ . 69708)]) (byte-code "\300\301\302\303#\300\207" [function-put persp--state-frame-persps side-effect-free t] 4) #@81 compiler-macro for inlining `persp--state-frame-order'. (fn CL-WHOLE-ARG CL-X) (defalias 'persp--state-frame-order--cmacro #[514 "\300\301\302\303\211\211&\207" [cl--defsubst-expand (cl-x) (cl-block persp--state-frame-order (progn (or (persp--state-frame-p cl-x) (signal 'wrong-type-argument (list 'persp--state-frame cl-x))) (aref cl-x 2))) nil] 9 (#$ . 70087)]) (put 'persp--state-frame-order 'compiler-macro 'persp--state-frame-order--cmacro) #@69 Access slot "order" of `persp--state-frame' struct CL-X. (fn CL-X) (defalias 'persp--state-frame-order #[257 "\301!>\204\302\303\304D\"\210\211\305H\207" [cl-struct-persp--state-frame-tags type-of signal wrong-type-argument persp--state-frame 2] 5 (#$ . 70543)]) (byte-code "\300\301\302\303#\304\305\306\"\207" [function-put persp--state-frame-order side-effect-free t defalias copy-persp--state-frame copy-sequence] 4) #@99 compiler-macro for inlining `make-persp--state-frame'. (fn CL-WHOLE &cl-quote &key PERSPS ORDER) (defalias 'make-persp--state-frame--cmacro #[385 "\300\301\"A@\300\302\"A@\211\2037\211@\303>\203 \211AA\262\202 \304>A@\203.\305\262\202 \306\307@\"\210\202 \210\310\311\312\305\305&\207" [plist-member :persps :order (:persps :order :allow-other-keys) :allow-other-keys nil error "Keyword argument %s not one of (:persps :order)" cl--defsubst-expand (persps order) (cl-block make-persp--state-frame (record 'persp--state-frame persps order))] 12 (#$ . 70976)]) (put 'make-persp--state-frame 'compiler-macro 'make-persp--state-frame--cmacro) #@79 Constructor for objects of type `persp--state-frame'. (fn &key PERSPS ORDER) (defalias 'make-persp--state-frame #[128 "\300\301\"A@\300\302\"A@\211\2037\211@\303>\203 \211AA\262\202 \304>A@\203.\305\262\202 \306\307@\"\210\202 \210\310\311#\207" [plist-member :persps :order (:persps :order :allow-other-keys) :allow-other-keys nil error "Keyword argument %s not one of (:persps :order)" record persp--state-frame] 7 (#$ . 71642)]) (byte-code "\300\301\302\303#\304\305\306\307\310\306\311\312\305\303& \207" [function-put make-persp--state-frame side-effect-free t cl-struct-define persp--state-frame nil cl-structure-object record ((cl-tag-slot) (persps) (order)) cl-struct-persp--state-frame-tags] 11) #@78 compiler-macro for inlining `persp--state-single-p'. (fn CL-WHOLE-ARG CL-X) (defalias 'persp--state-single-p--cmacro #[514 "\300\301\302\303\211\211&\207" [cl--defsubst-expand (cl-x) (cl-block persp--state-single-p (and (memq (type-of cl-x) cl-struct-persp--state-single-tags) t)) nil] 9 (#$ . 72369)]) (put 'persp--state-single-p 'compiler-macro 'persp--state-single-p--cmacro) #@13 (fn CL-X) (defalias 'persp--state-single-p #[257 "\301!>\205 \302\207" [cl-struct-persp--state-single-tags type-of t] 3 (#$ . 72758)]) (byte-code "\300\301\302\303#\304\305\306\301#\207" [function-put persp--state-single-p side-effect-free error-free put persp--state-single cl-deftype-satisfies] 5) #@84 compiler-macro for inlining `persp--state-single-buffers'. (fn CL-WHOLE-ARG CL-X) (defalias 'persp--state-single-buffers--cmacro #[514 "\300\301\302\303\211\211&\207" [cl--defsubst-expand (cl-x) (cl-block persp--state-single-buffers (progn (or (persp--state-single-p cl-x) (signal 'wrong-type-argument (list 'persp--state-single cl-x))) (aref cl-x 1))) nil] 9 (#$ . 73069)]) (put 'persp--state-single-buffers 'compiler-macro 'persp--state-single-buffers--cmacro) #@72 Access slot "buffers" of `persp--state-single' struct CL-X. (fn CL-X) (defalias 'persp--state-single-buffers #[257 "\301!>\204\302\303\304D\"\210\211\305H\207" [cl-struct-persp--state-single-tags type-of signal wrong-type-argument persp--state-single 1] 5 (#$ . 73542)]) (byte-code "\300\301\302\303#\300\207" [function-put persp--state-single-buffers side-effect-free t] 4) #@84 compiler-macro for inlining `persp--state-single-windows'. (fn CL-WHOLE-ARG CL-X) (defalias 'persp--state-single-windows--cmacro #[514 "\300\301\302\303\211\211&\207" [cl--defsubst-expand (cl-x) (cl-block persp--state-single-windows (progn (or (persp--state-single-p cl-x) (signal 'wrong-type-argument (list 'persp--state-single cl-x))) (aref cl-x 2))) nil] 9 (#$ . 73929)]) (put 'persp--state-single-windows 'compiler-macro 'persp--state-single-windows--cmacro) #@72 Access slot "windows" of `persp--state-single' struct CL-X. (fn CL-X) (defalias 'persp--state-single-windows #[257 "\301!>\204\302\303\304D\"\210\211\305H\207" [cl-struct-persp--state-single-tags type-of signal wrong-type-argument persp--state-single 2] 5 (#$ . 74402)]) (byte-code "\300\301\302\303#\304\305\306\"\207" [function-put persp--state-single-windows side-effect-free t defalias copy-persp--state-single copy-sequence] 4) #@103 compiler-macro for inlining `make-persp--state-single'. (fn CL-WHOLE &cl-quote &key BUFFERS WINDOWS) (defalias 'make-persp--state-single--cmacro #[385 "\300\301\"A@\300\302\"A@\211\2037\211@\303>\203 \211AA\262\202 \304>A@\203.\305\262\202 \306\307@\"\210\202 \210\310\311\312\305\305&\207" [plist-member :buffers :windows (:buffers :windows :allow-other-keys) :allow-other-keys nil error "Keyword argument %s not one of (:buffers :windows)" cl--defsubst-expand (buffers windows) (cl-block make-persp--state-single (record 'persp--state-single buffers windows))] 12 (#$ . 74848)]) (put 'make-persp--state-single 'compiler-macro 'make-persp--state-single--cmacro) #@83 Constructor for objects of type `persp--state-single'. (fn &key BUFFERS WINDOWS) (defalias 'make-persp--state-single #[128 "\300\301\"A@\300\302\"A@\211\2037\211@\303>\203 \211AA\262\202 \304>A@\203.\305\262\202 \306\307@\"\210\202 \210\310\311#\207" [plist-member :buffers :windows (:buffers :windows :allow-other-keys) :allow-other-keys nil error "Keyword argument %s not one of (:buffers :windows)" record persp--state-single] 7 (#$ . 75538)]) (byte-code "\300\301\302\303#\304\305\306\307\310\306\311\312\305\303& \207" [function-put make-persp--state-single side-effect-free t cl-struct-define persp--state-single nil cl-structure-object record ((cl-tag-slot) (buffers) (windows)) cl-struct-persp--state-single-tags] 11) #@15 (fn BUFFER) (defalias 'persp--state-interesting-buffer-p #[257 "\301!\205\302\303\301!\"?\205\304!\206r\211q\210)\305=\207" [major-mode buffer-name string-match "^[[:space:]]*\\*" buffer-file-name dired-mode] 5 (#$ . 76286)]) (defalias 'persp--state-file-data #[0 "\301 \302\211:\203*@\262\303!\203#\304!\206rq\210)B\262A\262\202\211\237\207" [default-directory buffer-list nil persp--state-interesting-buffer-p buffer-file-name] 5]) #@1487 This is a primitive code walker. It removes references to potentially problematic buffers from the data structure created by window-state-get and replaces them with references to the perspective-specific *scratch* buffer. Buffers are considered 'problematic' when they have no underlying file, or are otherwise transient. The need for a recursive walk, and the consequent complexity of this function, arises from the nature of the data structure returned by window-state-get. That data structure is essentially a tree represented as a Lisp list. It can contain several kinds of nodes, including properties, nested trees representing window splits, and windows (referred to internally as leaf nodes). For the purposes of preserving window state, we only care about nodes in this data structure which refer to buffers, i.e., lists with the symbol 'buffer in the first element. These 'buffer lists can be deeply buried inside the data structure, because it recursively describes the layout of all windows in the given frame. They are always nested in lists with the symbol 'leaf in the first element. And so, the walker descends the data structure and preserves everything it finds. When it notices a 'leaf, it iterates over its properties until it finds a 'buffer. If the 'buffer points to a buffer which can be reasonably saved, it leaves it alone. Otherwise, it replaces that buffer's node with one which points to the perspective's *scratch* buffer. (fn ENTRY PERSP VALID-BUFFERS) (defalias 'persp--state-window-state-massage #[771 ":\204\207A:\204\207@\300=\203[A\300\301\211:\203U@\262@\302=\2040\202JA@\211\235\203>\202H\302\303 !AABB\262B\262A\262\202\211\237\266\203B\207@A\301\211:\203|@\262\304#B\262A\262\202a\211\237\266\203B\207" [leaf nil buffer persp-scratch-buffer persp--state-window-state-massage] 12 (#$ . 76757)]) (defalias 'persp--state-frame-data #[0 "\301 \302\211:\203\341@\262\303\304\"\203\332\305 p\306\307#\216\310\311\"\210\312\313\314\"\315 \211\302:\203\312@\262\316\317\320 \"!\204\303\321 \205D\322 \323 \306\324\"\216\325\311\"\210\321 \326!>\204a\327\330\331D\"\210\211\332H\262\302\211:\203\205@\262\333!\203~\334!B\262A\262\202h\211\237\266\203\335\336 \337\"\302\211:\203\253@\262\340#B\262A\262\202\220\211\237\266\203\341\342\343#\n#\266)\344\302\345#\266A\262\202*\266\342\346#\266\202)\266\202B\262A\262\202\211\237\207" [cl-struct-perspective-tags frame-list nil frame-parameter persp--hash selected-frame make-closure #[0 "\302\300!\203 \303\300\304\"\210\305\301!\205\301q\207" [V0 V1 frame-live-p select-frame norecord buffer-live-p] 3] select-frame norecord make-hash-table :test equal persp-names persp-killed-p gethash perspectives-hash persp-curr persp-current-name persp-last #[0 "\300\205\301\300\302\"\207" [V0 persp-switch norecord] 3] persp-switch type-of signal wrong-type-argument perspective 2 persp--state-interesting-buffer-p buffer-name window-state-get frame-root-window t persp--state-window-state-massage puthash record persp--state-single set-frame-parameter persp--last persp--state-frame] 19]) #@534 Save the current perspective state to FILE. FILE defaults to the value of persp-state-default-file if it is set. Each perspective's buffer list and window layout will be saved. Frames and their associated perspectives will also be saved, but not the original frame sizes. Buffers with * characters in their names, as well as buffers without associated files will be ignored. If such buffers are currently visible in a perspective as windows, they will be saved as '*scratch* (persp)' buffers. (fn &optional FILE INTERACTIVE\=\?) (defalias 'persp-state-save #[512 "\3032\236\204\304\305!\210\306\303\307\"\210\203!\310\230\204!\311!\2024\211?\2054 \2054 \310\230?\2054\311 !\211\204<\312\313!\210\314!\203f \203R \310\230\204R\311 !\202S\310\230\204f\n\204f\315\316!\204f\312\317!\210\320\321!\210\322 \210\323\324\325 \326\327 $\330\331\332\"\333\334\"\216r\211q\210\335p\"\210)r\211q\210\336\307\211\307\337%\210*\266\320\340!\2620\207" [persp-mode persp-state-default-file current-prefix-arg --cl-block-persp-state-save-- message "persp-mode not enabled, nothing to save" throw nil "" expand-file-name user-error "No target file specified" file-exists-p yes-or-no-p "Target file exists. Overwrite? " "Cancelled persp-state-save" run-hooks persp-state-before-save-hook persp-save make-persp--state-complete :files persp--state-file-data :frames persp--state-frame-data generate-new-buffer " *temp file*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] prin1 write-region 0 persp-state-after-save-hook] 12 (#$ . 79951) (byte-code "\301\302\211#\303D\207" [persp-state-default-file read-file-name "Save perspective state to file: " t] 4)]) #@259 Restore the perspective state saved in FILE. FILE defaults to the value of persp-state-default-file if it is set. Frames are restored, along with each frame's perspective list. Each perspective's buffer list and window layout are also restored. (fn FILE) (defalias 'persp-state-load #[257 "\303!\204 \304\305\"\210\306\307!\210\310\311!\210\312\313\314\315\316\317\"!\314\315\316\317\"!#\320\321\322\323\324\"r\211q\210\325\326\"\216\327!\210\330 *\262!\331!\210\332!>\204N\333\334\335D\"\210\211\307H\336:\203l@\262\303!\203e\337!\210A\262\202R\266\332!>\204}\333\334\335D\"\210\211\340H\336:\203'@\262T\262\307V\203\227\341 \210\332! >\204\246\333\334\342D\"\210\211\307H\343\332! >\204\271\333\334\342D\"\210\340H!\211\336:\203@\262\344\"\331!\210\332!\n>\204\337\333\334\345D\"\210\211\307H\336:\203\367@\262\346!\210A\262\202\343\266\347 \210\350\332!\n>\204\f\333\334\345D\"\210\340H\351\352 !\353#\266A\262\202\277\266A\262\202\201\266\354!\266\310\355!\207" [cl-struct-persp--state-complete-tags cl-struct-persp--state-frame-tags cl-struct-persp--state-single-tags file-exists-p user-error "File not found: %s" persp-mode 1 run-hooks persp-state-before-load-hook format "%04x%04x" random expt 16 4 0 read generate-new-buffer " *temp*" t make-closure #[0 "\301\300!\205 \302\300!\207" [V0 buffer-name kill-buffer] 2] insert-file-contents-literally buffer-string persp-switch type-of signal wrong-type-argument persp--state-complete nil find-file 2 make-frame-command persp--state-frame reverse gethash persp--state-single persp-add-buffer split-window-horizontally window-state-put frame-root-window selected-frame safe persp-kill persp-state-after-load-hook] 16 (#$ . 81665) (byte-code "\301\302\211#C\207" [persp-state-default-file read-file-name "Restore perspective state from file: "] 4)]) (byte-code "\300\301\302\"\210\303\304!\207" [defalias persp-state-restore persp-state-load provide perspective] 3)