;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. #@72 Set up a simple situation where the parenthood check should error out. (defalias 'cab-setup-parenthood-check #[nil "\302\303!\302\304!\305 \"\210\305 \"*\207" [b1 b0 find-file-noselect "b0" "b1" cab-register] 3 (#$ . 87)]) #@71 Set up a large situation where the parenthood check should error out. (defalias 'cab-setup-parenthood-check-1 #[nil "\306\307!\306\310!\306\311!\306\312!\306\313!\306\314!\306\315!\306\316!\306\317!\306\320!\321\322 \n \f \257 \"\210\323\". \207" [b0 b1 b2 b3 b4 b5 find-file-noselect "bb0" "bb1" "bb2" "bb3" "bb4" "bb5" "bb6" "bb7" "bb8" "bb9" mapc #[(b) "\302 \"\210\211\207" [b parent cab-register] 3] cab-register b6 b7 b8 b9 parent] 11 (#$ . 320)]) #@60 A buffer for holding information about affiliated buffers. (defvar OBS-*cab-info-buffer* (get-buffer-create "*cab info*") (#$ . 811)) (byte-code "\301\302!\301\207" [OBS-*cab-info-buffer* get-buffer-create "*cab info*"] 2) #@156 Hook to run when killing a buffer. The intent is to glean information about any buffers that cpio-mode might be using that are affiliated with each other. (defalias 'OBS-cab-test-kill-buffer-hook #[nil "\305p\306\307\310p!\"?\205Cr\nq\210db\210\311\312\310! \203$\310 !\202%\313#c\210rq\210\f)\203@\314c\210\315\316rq\210\f)\"\202B\317c)*\207" [buf fname *cab-info-buffer* *cab-parent* *cab-subordinates* "cab-test-kill-buffer-hook" string-match "\\` " buffer-name format "\n\nKilling buffer [[%s]].\n It has parent [[%s]].\n" "nil" " It has subordinates:\n" mapc #[(b) "\301\302\"c\207" [b format " [[%s]]\n"] 3] " No subordinates.\n"] 5 (#$ . 1042)]) #@157 Record some information about the registration of a BUFFER as an affiliated buffer. It's not strictly a hook, but it pairs with the above kill-buffer-hook. (defalias 'OBS-cab-test-register-buffer-hook #[(buffer parent) "\305r q\210db\210\306\307\310\n!\310 !#c\210\306\311\310 !\"c\210\312\313r q\210\f)\"*\207" [fname *cab-info-buffer* buffer parent *cab-subordinates* "cab-test-register-buffer-hook" format "Registering [[%s]] with [[%s]] as its parent.\n" buffer-name " [[%s]] currently has the following subordinates.\n" mapc #[(b) "\301\302\303!\"c\207" [b format " [[%s]]\n" buffer-name] 4]] 5 (#$ . 1729)]) #@42 Clear the Affiliated Info Buffer if set. (custom-declare-variable 'cab-clear-cab-info-buffer nil '(#$ . 2361) :type 'boolean :group 'cab) #@67 A list of subordinate buffers affiliated with the current buffer. (defvar *cab-subordinates* nil (#$ . 2505)) (byte-code "\301\302\300!\207" [*cab-subordinates* nil make-variable-buffer-local] 2) #@44 The parent buffer of an affiliated buffer. (defvar *cab-parent* nil (#$ . 2708)) (byte-code "\301\302\300!\207" [*cab-parent* nil make-variable-buffer-local] 2) #@221 Register the given BUFFER as an affiliate of the PARENT buffer. If BUFFER is already an affiliate of PARENT, then succeed quietly. Return non-NIL on success. Return NIL if buffer is already affiliated to another parent. (defalias 'cab-register #[(buffer parent) "\305\306 !\204\307\310 #\210\306\n!\204\307\311\n#\210 \n\232\203'\307\312 \n$\210\313 \n\"\2035\307\314 \n$\210\315 \n\"\203@\316\202ur q\210\317\303!\205M\320 !)\203U\321\202ur q\210\n\322\323\324\"\210)r\nq\210 \fB\325\326\327\321\330$\210\322\323\331\"))\207" [fname buffer parent *cab-parent* *cab-subordinates* "cab-register" bufferp error "%s(): proposed buffer [[%s]] is not a buffer." "%s(): proposed parent buffer [[%s]] is not a buffer." "%s(): You can't affiliate a buffer [[%s]] with itself [[%s]]." cab-detect-parenthood-cycle "%s(): Registering [[%s]] as a subordinate of [[%s]] would create a cycle of parents." cab-registered-p t boundp buffer-live-p nil local-set-key " " #[nil "\301!\207" [buffer cab-deregister] 2] add-hook kill-buffer-hook cab-kill-buffer-hook local #[nil "\301!\207" [parent cab-deregister] 2]] 5 (#$ . 2877)]) #@83 Return non-NIL if affiliating BUFFER with PARENT would create a parenthood cycle. (defalias 'cab-detect-parenthood-cycle #[(buffer parent) "\304r q\210\30520 \205/r q\210p\n=\203 \306\305\307\"\210\202+ \204) \202+ )\202\n0*\207" [fname parent buffer *cab-parent* "cab-detect-parenthood-cycle" detected throw t] 3 (#$ . 4017)]) #@100 Return non-NIL if BUFFER is already registered to PARENT. CONTRACT: BUFFER and PARENT are buffers. (defalias 'cab-registered-p #[(buffer parent) "\304 \203\305 !\203\306 !\204\307\202>\n\203&\305\n!\203&\306\n!\204*\307\202>\305\n!\205>\306\n!\205>r\nq\210 \235))\207" [fname buffer parent *cab-subordinates* "cab-registered-p" bufferp buffer-live-p nil] 2 (#$ . 4362)]) #@77 Kill the current buffer and remove any affiliation (parent or subordinate). (defalias 'cab-kill-buffer-hook #[nil "\304p\305p!\203\305\n!\205r\nq\210\306 \")\202\307*\207" [buffer fname *cab-parent* *cab-subordinates* "cab-kill-buffer-hook" buffer-live-p delete t] 3 (#$ . 4754)]) #@252 Deregister and kill BUFFER and all its subordinate buffers. Note that that will include their subordinates too. Remove its registry entry in its parent buffer. NOTE: Use this function instead of (kill-buffer) if you want to lose registry information. (defalias 'cab-deregister #[(buffer) "\306\307\211\310 !\203Gr q\210\f )\311\312\"\210 \203;\313 !\203;\310 !\203;\314 \"\203;r q\210\315 \")\310 !\205H\316 !\202H\307+\207" [subordinates parent fname buffer *cab-parent* *cab-subordinates* "cab-deregister" nil buffer-live-p mapc cab-deregister bufferp cab-registered-p delete kill-buffer] 3 (#$ . 5051) nil]) #@64 Deregister BUFFER and all its subordinates, but don't kill it. (defalias 'cab-simple-deregister #[(buffer) "\306\307\211r q\210\f )\310\311\"\210r q\210\312 \"\211,\207" [subordinates parent fname buffer *cab-parent* *cab-subordinates* "cab-simple-deregister" nil mapc cab-simple-deregister delete] 3 (#$ . 5684)]) #@107 Clean up affiliated buffers. CAVEAT: This function should disappear as affiliated buffer code stabilizes. (defalias 'cab-clean #[nil "\301\302\303\304 \")\207" [fname "cab-clean" mapc #[(b) "rq\210\302\301!\205\303 !\211)\207" [b *cab-subordinates* boundp delete-dups] 2] buffer-list] 3 (#$ . 6014) nil]) #@64 Get rid of all buffers that are affiliated with other buffers. (defalias 'cab-clean-ruthlessly #[nil "\301\302\303\304 \")\207" [fname "cab-clean-2" mapc #[(b) "\303!\205\"rq\210\304\301!\203 \204\304\302!\205!\n\205!\305!)\207" [b *cab-parent* *cab-subordinates* buffer-live-p boundp cab-deregister] 2] buffer-list] 3 (#$ . 6330)]) (provide 'cpio-affiliated-buffers)