;ELC ;;; compiled by cthomp@willow on Thu Aug 12 00:45:06 1993 ;;; from file /era/era-0.80/editor/lisp/pcl-cvs/cookie.el ;;; emacs version 19.8 (beta8) Lucid. ;;; bytecomp version 2.15; 14-jul-93. ;;; optimization is on. ;;; this file uses opcodes which do not exist in Emacs 18. (if (and (boundp 'emacs-version) (or (and (boundp 'epoch::version) epoch::version) (string-lessp emacs-version "19"))) (error "This file was compiled for Emacs 19.")) (byte-code "!!#M#MMMMMMMMMMMMMMMMMMMMMMMMM" [require dll provide cookie put icookie-set-buffer-bind-dll lisp-indent-hook 1 (macro . #[(collection &rest forms) "!! D D DDE DD\" DEF*" [make-symbol "old-buffer" "collection" hnd old-buffer let* (current-buffer) collection dll icookie-collection->dll set-buffer icookie-collection->buffer unwind-protect append (progn) forms] 7]) icookie-set-buffer-bind-dll-let* 2 (macro . #[(collection varlist &rest forms) "!! D D DDE \" DD\" DEF*" [make-symbol "old-buffer" "collection" hnd old-buffer let* append (current-buffer) collection dll icookie-collection->dll varlist set-buffer icookie-collection->buffer unwind-protect (progn) forms] 7]) icookie-filter-hf (macro . #[(collection tin) "!! D DD DE DEE FE*" [make-symbol "tin" "tmpcollection" tmpcoll tempvar let tin collection if or eq icookie-collection->header icookie-collection->footer nil] 9]) icookie-create-wrapper #[(start-marker cookie) "\n \"B" [WRAPPER vector start-marker cookie] 4] icookie-wrapper->start-marker #[(wrapper) "A" [wrapper 0] 2] icookie-wrapper->cookie-safe #[(wrapper) "A" [wrapper 1] 2] icookie-wrapper->cookie #[(wrapper) "A" [wrapper 1] 2] icookie-create-collection #[(buffer pretty-printer header-wrapper footer-wrapper dll) "\n &B" [COLLECTION vector buffer pretty-printer header-wrapper footer-wrapper dll nil] 8] icookie-collection->buffer #[(collection) "A" [collection 0] 2] icookie-collection->pretty-printer #[(collection) "A" [collection 1] 2] icookie-collection->header #[(collection) "A" [collection 2] 2] icookie-collection->footer #[(collection) "A" [collection 3] 2] icookie-collection->dll #[(collection) "A" [collection 4] 2] icookie-collection->last-tin #[(collection) "A" [collection 5] 2] icookie-set-collection->buffer #[(collection buffer) "A\nI" [collection 0 buffer] 3] icookie-set-collection->pretty-printer #[(collection pretty-printer) "A\nI" [collection 1 pretty-printer] 3] icookie-set-collection->header #[(collection header) "A\nI" [collection 2 header] 3] icookie-set-collection->footer #[(collection footer) "A\nI" [collection 3 footer] 3] icookie-set-collection->dll #[(collection dll) "A\nI" [collection 4 dll] 3] icookie-set-collection->last-tin #[(collection last-tin) "A\nI" [collection 5 last-tin] 3] icookie-abs #[(x) "[]" [x] 2] icookie-create-wrapper-and-insert #[(cookie string pos) "b!!!! ! \"+" [pos markerp marker-position nil buffer-read-only start insert-before-markers string 10 icookie-create-wrapper copy-marker cookie] 3] icookie-create-wrapper-and-pretty-print #[(cookie pretty-printer pos) "b!!!!\n ! ! \"+" [pos markerp marker-position nil buffer-read-only start insert-before-markers 10 backward-char 1 pretty-printer cookie icookie-create-wrapper copy-marker] 3] icookie-delete-tin-internal #[(collection tin) " ! != \"H! \"H!|H!‰ \"*" [icookie-collection->dll collection nil buffer-read-only dll icookie-collection->last-tin tin icookie-set-collection->last-tin icookie-wrapper->start-marker 2 dll-next dll-delete] 5] icookie-refresh-tin #[(collection tin) " H! \"H!!S| H!b ! H!!*" [nil buffer-read-only icookie-wrapper->start-marker tin 2 marker-position dll-next dll icookie-collection->pretty-printer collection icookie-wrapper->cookie] 6] icookie-pos-before-middle-p #[(collection pos tin1 tin2) " ! H!H!\\ƥW)" [icookie-collection->dll collection dll pos icookie-wrapper->start-marker tin1 2 tin2] 5]] 4) (fset 'collection-create #[(buffer pretty-printer &optional header footer pos) "\n! ĉ %p!\n!q̎  e!!L# #\n\"\n\"\n\"\"\n\"\".)" [icookie-create-collection get-buffer-create buffer pretty-printer nil dll-create new-collection old-buffer collection icookie-collection->dll dll icookie-collection->buffer ((set-buffer old-buffer)) header "" footer pos markerp marker-position icookie-create-wrapper-and-insert head foot dll-enter-first dll-enter-last icookie-set-collection->header dll-nth 0 icookie-set-collection->footer -1] 6 "\ Create an empty collection of cookies. Args: BUFFER PRETTY-PRINTER &optional HEADER FOOTER POS. The collection will be inserted in BUFFER. BUFFER may be a buffer or a buffer name. It is created if it does not exist. PRETTY-PRINTER should be a function that takes one argument, a cookie, and inserts a string representing it in the buffer (at point). The string PRETTY-PRINTER inserts may be empty or span several linse. A trailing newline will always be inserted automatically. The PRETTY-PRINTER should use insert, and not insert-before-markers. Optional third argument HEADER is a string that will always be present at the top of the collection. HEADER should end with a newline. Optionaly fourth argument FOOTER is similar, and will always be inserted at the bottom of the collection. Optional fifth argument POS is a buffer position, specifying where the collection will be inserted. It defaults to the begining of the buffer."]) (fset 'tin-cookie #[(collection tin) " H!" [icookie-wrapper->cookie tin 2] 3 "\ Get the cookie from a TIN. Args: COLLECTION TIN."]) (fset 'cookie-enter-first #[(collection cookie) "p \n!\n!qƎ \" ! \"H!##," [old-buffer collection collection icookie-collection->dll dll icookie-collection->buffer ((set-buffer old-buffer)) dll-enter-after dll-nth 0 icookie-create-wrapper-and-pretty-print cookie icookie-collection->pretty-printer icookie-wrapper->start-marker 1 2] 10 "\ Enter a COOKIE first in the cookie collection COLLECTION. Args: COLLECTION COOKIE."]) (fset 'cookie-enter-last #[(collection cookie) "p \n!\n!qƎ \" ! !!##," [old-buffer collection collection icookie-collection->dll dll icookie-collection->buffer ((set-buffer old-buffer)) dll-enter-before dll-nth -1 icookie-create-wrapper-and-pretty-print cookie icookie-collection->pretty-printer icookie-wrapper->start-marker dll-last] 9 "\ Enter a COOKIE last in the cookie-collection COLLECTION. Args: COLLECTION COOKIE."]) (fset 'cookie-enter-after-tin #[(collection tin cookie) "p \n!\n!qƎ \n ! \"H!##," [old-buffer collection collection icookie-collection->dll dll icookie-collection->buffer ((set-buffer old-buffer)) dll-enter-after tin icookie-create-wrapper-and-pretty-print cookie icookie-collection->pretty-printer icookie-wrapper->start-marker dll-next 2] 10 "\ Enter a new COOKIE after TIN. Args: COLLECTION TIN COOKIE."]) (fset 'cookie-enter-before-tin #[(collection tin cookie) "p \n!\n!qƎ \n !H!##," [old-buffer collection collection icookie-collection->dll dll icookie-collection->buffer ((set-buffer old-buffer)) dll-enter-before tin icookie-create-wrapper-and-pretty-print cookie icookie-collection->pretty-printer icookie-wrapper->start-marker 2] 9 "\ Enter a new COOKIE before TIN. Args: COLLECTION TIN COOKIE."]) (fset 'tin-next #[(collection tin) " !\"  != !=? *" [tin dll-next icookie-collection->dll collection tmpcollection tin icookie-collection->header icookie-collection->footer] 4 "\ Get the next tin. Args: COLLECTION TIN. Returns nil if TIN is nil or the last cookie."]) (fset 'tin-previous #[(collection tin) " !\"  != !=? *" [tin dll-previous icookie-collection->dll collection tmpcollection tin icookie-collection->header icookie-collection->footer] 4 "\ Get the previous tin. Args: COLLECTION TIN. Returns nil if TIN is nil or the first cookie."]) (fset 'tin-nth #[(collection n) "WST !\"  != !=?*" [n 0 dll-nth icookie-collection->dll collection tmpcollection tin icookie-collection->header icookie-collection->footer] 4 "\ Return the Nth tin. Args: COLLECTION N. N counts from zero. Nil is returned if there is less than N cookies. If N is negative, return the -(N+1)th last element. Thus, (tin-nth dll 0) returns the first node, and (tin-nth dll -1) returns the last node. Use tin-cookie to extract the cookie from the tin (or use cookie-nth instead)."]) (fset 'cookie-nth #[(collection n) "WST ! \" !=!=?*\n\nH!*" [n 0 icookie-collection->dll collection dll dll-nth tmpcollection tin icookie-collection->header icookie-collection->footer tin icookie-wrapper->cookie 2] 4 "\ Return the Nth cookie. Args: COLLECTION N. N counts from zero. Nil is returned if there is less than N cookies. If N is negative, return the -(N+1)th last element. Thus, (cookie-nth dll 0) returns the first cookie, and (cookie-nth dll -1) returns the last cookie."]) (fset 'tin-delete #[(collection tin) "p \n!\n!qƎ  \"!," [old-buffer collection collection icookie-collection->dll dll icookie-collection->buffer ((set-buffer old-buffer)) icookie-wrapper->cookie icookie-delete-tin-internal tin] 4 "\ Delete a tin from a collection. Args: COLLECTION TIN. The cookie in the tin is returned."]) (fset 'cookie-delete-first #[(collection) "p \n! \"\n!qɎ !=? \"!-" [old-buffer collection collection icookie-collection->dll dll dll-nth 1 tin icookie-collection->buffer ((set-buffer old-buffer)) icookie-collection->footer icookie-wrapper->cookie icookie-delete-tin-internal] 4 "\ Delete first cookie and return it. Args: COLLECTION. Returns nil if there are no cookies left in the collection."]) (fset 'cookie-delete-last #[(collection) "p \n! \"\n!qɎ !=? \"!-" [old-buffer collection collection icookie-collection->dll dll dll-nth -2 tin icookie-collection->buffer ((set-buffer old-buffer)) icookie-collection->header icookie-wrapper->cookie icookie-delete-tin-internal] 4 "\ Delete last cookie and return it. Args: COLLECTION. Returns nil if there is no cookie left in the collection."]) (fset 'cookie-first #[(collection) " !\n\"  != !=?*  H!*" [icookie-collection->dll collection dll dll-nth -1 tmpcollection tin icookie-collection->header icookie-collection->footer tin icookie-wrapper->cookie 2] 4 "\ Return the first cookie in COLLECTION. The cookie is not removed."]) (fset 'cookie-last #[(collection) " !\n\"  != !=?*  H!*" [icookie-collection->dll collection dll dll-nth -2 tmpcollection tin icookie-collection->header icookie-collection->footer tin icookie-wrapper->cookie 2] 4 "\ Return the last cookie in COLLECTION. The cookie is not removed."]) (fset 'collection-empty #[(collection) "\n!\"\n!=" [dll-nth icookie-collection->dll collection 1 icookie-collection->footer] 3 "\ Return true if there are no cookies in COLLECTION."]) (fset 'collection-length #[(collection) "\n!!Z" [dll-length icookie-collection->dll collection 2] 3 "\ Return the number of cookies in COLLECTION."]) (fset 'collection-list-cookies #[(collection) "p \n! ! \" \n!q͎ = H!B  \" f." [old-buffer collection collection icookie-collection->dll dll nil result icookie-collection->header header dll-nth -2 tin icookie-collection->buffer ((set-buffer old-buffer)) icookie-wrapper->cookie 2 dll-previous] 4 "\ Return a list of all cookies in COLLECTION."]) (fset 'collection-clear #[(collection) "p \n! ! !\n!qʎ \"H!H!|)HHD! \" \"\" \"\"." [old-buffer collection collection icookie-collection->dll dll icookie-collection->header header icookie-collection->footer footer icookie-collection->buffer ((set-buffer old-buffer)) nil buffer-read-only icookie-wrapper->start-marker dll-nth 1 2 dll-create-from-list icookie-set-collection->dll icookie-set-collection->header 0 icookie-set-collection->footer -1] 5 "\ Remove all cookies in COLLECTION."]) (fset 'cookie-map #[(map-function collection &rest map-args) "p \n! ! \" \n!qˎ =?  H!#  \"  \" \\." [old-buffer collection collection icookie-collection->dll dll icookie-collection->footer footer dll-nth 1 tin icookie-collection->buffer ((set-buffer old-buffer)) apply map-function icookie-wrapper->cookie 2 map-args icookie-refresh-tin dll-next] 6 "\ Apply MAP-FUNCTION to all cookies in COLLECTION. MAP-FUNCTION is applied to the first element first. If MAP-FUNCTION returns non-nil the cookie will be refreshed (its pretty-printer will be called once again). Note that the buffer for COLLECTION will be current buffer when MAP-FUNCTION is called. MAP-FUNCTION must restore the current buffer to BUFFER before it returns, if it changes it. If more than two arguments are given to cookie-map, remaining arguments will be passed to MAP-FUNCTION."]) (fset 'cookie-map-reverse #[(map-function collection &rest map-args) "p \n! ! \" \n!qˎ =?  H!#  \"  \" \\." [old-buffer collection collection icookie-collection->dll dll icookie-collection->header header dll-nth -2 tin icookie-collection->buffer ((set-buffer old-buffer)) apply map-function icookie-wrapper->cookie 2 map-args icookie-refresh-tin dll-previous] 6 "\ Apply MAP-FUNCTION to all cookies in COLLECTION. MAP-FUNCTION is applied to the last cookie first. If MAP-FUNCTION returns non-nil the cookie will be refreshed. Note that the buffer for COLLECTION will be current buffer when MAP-FUNCTION is called. MAP-FUNCTION must restore the current buffer to BUFFER before it returns, if it changes the current buffer. If more than two arguments are given to cookie-map, remaining arguments will be passed to MAP-FUNCTION."]) (fset 'collection-append-cookies #[(collection cookie-list) "\n@\"AtÇ" [cookie-list cookie-enter-last collection nil] 4 "\ Insert all cookies in the list COOKIE-LIST last in COLLECTION. Args: COLLECTION COOKIE-LIST."]) (fset 'collection-filter-cookies #[(collection predicate &rest extra-args) "p \n! \" !  \n!q͎ =? \" H!# \" X." [old-buffer collection collection icookie-collection->dll dll dll-nth 1 tin icookie-collection->footer footer nil next icookie-collection->buffer ((set-buffer old-buffer)) dll-next apply predicate icookie-wrapper->cookie 2 extra-args icookie-delete-tin-internal] 6 "\ Remove all cookies in COLLECTION for which PREDICATE returns nil. Args: COLLECTION PREDICATE &rest EXTRA-ARGS. Note that the buffer for COLLECTION will be current-buffer when PREDICATE is called. PREDICATE must restore the current buffer before it returns if it changes it. The PREDICATE is called with the cookie as its first argument. If any EXTRA-ARGS are given to collection-filter-cookies they will be passed to the PREDICATE."]) (fset 'collection-filter-tins #[(collection predicate &rest extra-args) "p \n! \" !  \n!q͎ =? \" # \" \\." [old-buffer collection collection icookie-collection->dll dll dll-nth 1 tin icookie-collection->footer footer nil next icookie-collection->buffer ((set-buffer old-buffer)) dll-next apply predicate extra-args icookie-delete-tin-internal] 5 "\ Remove all cookies in COLLECTION for which PREDICATE returns nil. Note that the buffer for COLLECTION will be current-buffer when PREDICATE is called. PREDICATE must restore the current buffer before it returns if it changes it. The PREDICATE is called with one argument, the tin. If any EXTRA-ARGS are given to collection-filter-cookies they will be passed to the PREDICATE."]) (fset 'tin-locate #[(collection pos &optional guess) "p \n! !\n!qȎ \" \"=̂ \"H!W \" !!Y \" \" H!Z! H!Z!W* \" H!Z!W* ! ! H!Z!W* H!Y H!Y \"l \" H!W \"l*-" [old-buffer collection collection icookie-collection->dll dll icookie-collection->footer footer icookie-collection->buffer ((set-buffer old-buffer)) dll-nth 1 -1 nil pos icookie-wrapper->start-marker 2 dll-last -2 best-guess icookie-abs distance guess g d icookie-collection->last-tin dll-next dll-previous] 6 "\ Return the tin that POS (a buffer position) is within. Args: COLLECTION POS &optional GUESS. POS may be a marker or an integer. GUESS should be a tin that it is likely that POS is near. If POS points before the first cookie, the first cookie is returned. If POS points after the last cookie, the last cookie is returned. If the COLLECTION is empty, nil is returned."]) (fset 'collection-refresh #[(collection) "p \n! ! !\n!qʎ \"H!H!|H!b \"=H!`˓ !H!!c \"Y*H!`˓." [old-buffer collection collection icookie-collection->dll dll icookie-collection->header header icookie-collection->footer footer icookie-collection->buffer ((set-buffer old-buffer)) nil buffer-read-only icookie-wrapper->start-marker dll-nth 1 2 tin icookie-collection->pretty-printer icookie-wrapper->cookie "\n" dll-next] 5 "\ Refresh all cookies in COLLECTION. The pretty-printer that was specified when the COLLECTION was created will be called for all cookies in COLLECTION. Note that tin-invalidate is more efficient if only a small number of cookies needs to be refreshed."]) (fset 'tin-invalidate #[(collection &rest tins) "p \n!\n!qƎ @\"Aq," [old-buffer collection collection icookie-collection->dll dll icookie-collection->buffer ((set-buffer old-buffer)) tins icookie-refresh-tin nil] 4 "\ Refresh some cookies. Args: COLLECTION &rest TINS. The pretty-printer that for COLLECTION will be called for all TINS."]) (fset 'collection-set-goal-column #[(collection goal) "p \n!\n!qƎ! ," [old-buffer collection collection icookie-collection->dll dll icookie-collection->buffer ((set-buffer old-buffer)) make-local-variable goal-column goal] 2 "\ Set goal-column for COLLECTION. Args: COLLECTION GOAL. goal-column is made buffer-local. There will eventually be a better way to specify the cursor position."]) (fset 'tin-goto-previous #[(collection pos arg) "p \n!  !#\n!qʎ V S \"k !=!=?* \"H!b! \"-" [old-buffer collection collection icookie-collection->dll dll tin-locate pos icookie-collection->last-tin tin icookie-collection->buffer ((set-buffer old-buffer)) arg 0 dll-previous tmpcollection tin icookie-collection->header icookie-collection->footer dll-nth 1 icookie-wrapper->start-marker 2 goal-column move-to-column icookie-set-collection->last-tin] 6 "\ Move point to the ARGth previous cookie. Don't move if we are at the first cookie, or if COLLECTION is empty. Args: COLLECTION POS ARG. Returns the tin we move to."]) (fset 'tin-goto-next #[(collection pos arg) "p \n!  !#\n!qʎ V S \"k !=!=?* \"H!b! \"-" [old-buffer collection collection icookie-collection->dll dll tin-locate pos icookie-collection->last-tin tin icookie-collection->buffer ((set-buffer old-buffer)) arg 0 dll-next tmpcollection tin icookie-collection->header icookie-collection->footer dll-nth -2 icookie-wrapper->start-marker 2 goal-column move-to-column icookie-set-collection->last-tin] 6 "\ Move point to the ARGth next cookie. Don't move if we are at the last cookie. Args: COLLECTION POS ARG. Returns the tin."]) (fset 'tin-goto #[(collection tin) "p \n!\n!qƎH!b\n\n! \"," [old-buffer collection collection icookie-collection->dll dll icookie-collection->buffer ((set-buffer old-buffer)) icookie-wrapper->start-marker tin 2 goal-column move-to-column icookie-set-collection->last-tin] 3 "\ Move point to TIN. Args: COLLECTION TIN."]) (fset 'collection-collect-tin #[(collection predicate &rest predicate-args) "p \n! ! \"  \n!q͎ = H!#  B  \" \\ ." [old-buffer collection collection icookie-collection->dll dll icookie-collection->header header dll-nth -2 tin nil result icookie-collection->buffer ((set-buffer old-buffer)) apply predicate icookie-wrapper->cookie 2 predicate-args dll-previous] 6 "\ Select cookies from COLLECTION using PREDICATE. Return a list of all selected tins. PREDICATE is a function that takes a cookie as its first argument. The tins on the returned list will appear in the same order as in the buffer. You should not rely on in which order PREDICATE is called. Note that the buffer the COLLECTION is displayed in is current-buffer when PREDICATE is called. If PREDICATE must restore current-buffer if it changes it. If more than two arguments are given to collection-collect-tin the remaining arguments will be passed to PREDICATE."]) (fset 'collection-collect-cookie #[(collection predicate &rest predicate-args) "p \n! ! \"  \n!q͎ = H!# H! B  \" X ." [old-buffer collection collection icookie-collection->dll dll icookie-collection->header header dll-nth -2 tin nil result icookie-collection->buffer ((set-buffer old-buffer)) apply predicate icookie-wrapper->cookie 2 predicate-args dll-previous] 6 "\ Select cookies from COLLECTION using PREDICATE. Return a list of all selected cookies. PREDICATE is a function that takes a cookie as its first argument. The cookies on the returned list will appear in the same order as in the buffer. You should not rely on in which order PREDICATE is called. Note that the buffer the COLLECTION is displayed in is current-buffer when PREDICATE is called. If PREDICATE must restore current-buffer if it changes it. If more than two arguments are given to collection-collect-cookie the remaining arguments will be passed to PREDICATE."]) (fset 'cookie-sort #[(collection predicate) " \" !\" !\"" [icookie-set-collection->last-tin collection nil collection-append-cookies sort collection-list-cookies predicate collection-clear] 5 "\ Sort the cookies in COLLECTION, stably, comparing elements using PREDICATE. PREDICATE is called with two cookies, and should return T if the first cookie is \"less\" than the second. All cookies will be refreshed when the sort is complete."]) (fset 'collection-buffer #[(collection) " !\n!\n)" [icookie-collection->buffer collection buf buffer-name] 2 "\ Return the buffer that is associated with COLLECTION. Returns nil if the buffer has been deleted."])