;ELC   
;;; Compiled by rms@psilocin.gnu.org on Sun Apr 19 23:55:11 1998
;;; from file /gd/gnu/emacs/lisp/desktop.el
;;; in Emacs version 20.2.91.4
;;; with bytecomp version 2.40
;;; with all optimizations.
;;; This file uses opcodes which do not exist in Emacs 18.

(if (and (boundp 'emacs-version)
	 (< (aref emacs-version (1- (length emacs-version))) ?A)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.29")))
    (error "`desktop.el' was compiled for Emacs 19.29 or later"))


(custom-declare-group 'desktop nil "Save status of Emacs when you exit." :group 'frames)
#@67 *Non-nil enable Desktop to save the state of Emacs when you exit.
(custom-declare-variable 'desktop-enable 'nil '(#$ . -618) :group 'desktop :type 'boolean :require 'desktop :initialize 'custom-initialize-default :version "20.3")
#@59 File for Emacs desktop, not including the directory name.
(custom-declare-variable 'desktop-basefilename '(convert-standard-filename ".emacs.desktop") '(#$ . 854) :type 'file :group 'desktop)
#@101 *If non-nil then desktop warns when a file no longer exists.
Otherwise it simply ignores that file.
(custom-declare-variable 'desktop-missing-file-warning 'nil '(#$ . -1053) :type 'boolean :group 'desktop)
#@258 List of global variables to save when killing Emacs.
An element may be variable name (a symbol)
or a cons cell of the form  (VAR . MAX-SIZE),
which means to truncate VAR's value to at most MAX-SIZE elements
(if the value is a list) before saving the value.
(defvar desktop-globals-to-save (list 'desktop-missing-file-warning 'tags-file-name 'tags-table-list 'search-ring 'regexp-search-ring 'register-alist) (#$ . 1266))
#@107 List of local variables to save for each buffer.
The variables are saved only when they really are local.
(defvar desktop-locals-to-save (list 'desktop-locals-to-save 'truncate-lines 'case-fold-search 'case-replace 'fill-column 'overwrite-mode 'change-log-default-name 'line-number-mode) (#$ . 1694))
(make-variable-buffer-local 'desktop-locals-to-save)
#@65 Regexp identifying buffers that are to be excluded from saving.
(custom-declare-variable 'desktop-buffers-not-to-save '"\\(^nn\\.a[0-9]+\\|\\.log\\|(ftp)\\|^tags\\|^TAGS\\)$" '(#$ . 2054) :type 'regexp :group 'desktop)
#@72 Regexp identifying files whose buffers are to be excluded from saving.
(custom-declare-variable 'desktop-files-not-to-save '"^/[^/:]*:" '(#$ . 2279) :type 'regexp :group 'desktop)
#@67 When desktop creates a buffer, this holds the desired Major mode.
(custom-declare-variable 'desktop-buffer-major-mode 'nil '(#$ . 2465) :type 'symbol :group 'desktop)
#@67 When desktop creates a buffer, this holds the file name to visit.
(custom-declare-variable 'desktop-buffer-file-name 'nil '(#$ . 2638) :type '(choice file (const nil)) :group 'desktop)
#@68 When desktop creates a buffer, this holds the desired buffer name.
(custom-declare-variable 'desktop-buffer-name 'nil '(#$ . 2829) :type '(choice string (const nil)) :group 'desktop)
#@119 When desktop creates a buffer, this holds a list of misc info.
It is used by the `desktop-buffer-handlers' functions.
(defvar desktop-buffer-misc nil (#$ . 3019))
#@347 *List of functions to call in order to create a buffer.
The functions are called without explicit parameters but can use the
variables `desktop-buffer-major-mode', `desktop-buffer-file-name',
`desktop-buffer-name'.
If one function returns non-nil, no further functions are called.
If the function returns t then the buffer is considered created.
(custom-declare-variable 'desktop-buffer-handlers ''(desktop-buffer-dired desktop-buffer-rmail desktop-buffer-mh desktop-buffer-info desktop-buffer-file) '(#$ . -3189) :type '(repeat function) :group 'desktop)
#@46 Opening of form for creation of new buffers.
(defvar desktop-create-buffer-form "(desktop-create-buffer 205" (#$ . 3751))
#@109 Hook run before desktop saves the state of Emacs.
This is useful for truncating history lists, for example.
(custom-declare-variable 'desktop-save-hook 'nil '(#$ . 3880) :type 'hook :group 'desktop)
#@58 The directory in which the current desktop file resides.
(defvar desktop-dirname nil (#$ . 4085))
#@35 *Header to place in Desktop file.
(defconst desktop-header ";; --------------------------------------------------------------------------\n;; Desktop File for Emacs\n;; --------------------------------------------------------------------------\n" (#$ . -4189))
#@68 Hooks run after all buffers are loaded; intended for internal use.
(defvar desktop-delay-hook nil (#$ . 4456))
#@52 Truncate LIST to at most N elements destructively.
(defalias 'desktop-truncate #[(l n) "S	\233\211:\205 \n\303\241)\207" [n l here nil] 3 (#$ . 4573)])
#@55 *Buffer names that `desktop-clear' should not delete.
(custom-declare-variable 'desktop-clear-preserve-buffers ''("*scratch*" "*Messages*") '(#$ . -4734) :type '(repeat string) :group 'desktop)
#@122 Empty the Desktop.
This kills all buffers except for internal ones
and those listed in `desktop-clear-preserve-buffers'.
(defalias 'desktop-clear #[nil "\306\306\306\306\306\306\307 \211\203L \310@!\235\204C \310@!\203C \310@!\311\232\204= \310@!\312H\313=\204C \314@!\210A\211\204 )\315 \207" [kill-ring kill-ring-yank-pointer search-ring search-ring-yank-pointer regexp-search-ring regexp-search-ring-yank-pointer nil buffer-list buffer-name "" 0 32 kill-buffer delete-other-windows buffers desktop-clear-preserve-buffers] 3 (#$ . 4935) nil])
(add-hook 'kill-emacs-hook 'desktop-kill)
(defalias 'desktop-kill #[nil "\205 \301\302\303\217\207" [desktop-dirname err (desktop-save desktop-dirname) ((file-error (byte-code "\301\302!?\205 \303@A\"\207" [err yes-or-no-p "Error while saving the desktop.  Quit anyway? " signal] 3)))] 3])
(defalias 'desktop-list* #[(&rest args) "A\204 @\207\237\211A@@BAA\211\203& @	BA\211\204 	)\207" [args value] 3])
#@238 Convert VALUE to a pair (QUOTE . TXT); (eval (read TXT)) gives VALUE.
TXT is a string that when read and evaluated yields value.
QUOTE may be `may' (value may be quoted),
`must' (values must be quoted), or nil (value may not be quoted).
(defalias 'desktop-internal-v2s #[(val) "\247\204 \203 \306=\203 \307\310!B\207;\203- \311!\312\313	G\314	$\210\307\310	!)B\2079\2038 \315\310!B\207\316!\203b \314\317\320\"\n\203V \314\321\322\323\324#\325QB\202` \307\326\322\327\324#\330QB*\207:\203\360 \314\211\211-\211.:\203\227 \331.@!/\f\204\206 /@?/-B-).A\211.\202r .\203\304 \331.!-@01\f\204\260 1@?\f\204\272 \332-B-\3061-B-*-\237-\f\203\343 \314\203\326 \333\202\327 \334\322\335-\324#\325QB\202\356 \315\336\322\327-\324#\325QB,\207\337!\203\314\340\310!\341\342O\325QB\207\343!\203'\310\344!!\310\345\346!!!23\314\347\350\3513\3522\353\260*B\207\307\354B\207" [val copy special pass1 anynil use-list* t may prin1-to-string copy-sequence set-text-properties 0 nil must vectorp mapcar #[(el) "\303!\211@\204 \304	)\207" [el res special desktop-internal-v2s t] 3] "(vector " mapconcat #[(el) "@\301=\203\f \302AP\207A\207" [el must "'"] 2] " " ")" "[" cdr "]" desktop-internal-v2s (must . ".") "(desktop-list* " "(list " #[(el) "@\301=\203\f \302AP\207A\207" [el must "'"] 2] "(" subrp "(symbol-function '" 7 -1 markerp marker-position buffer-name marker-buffer "(let ((mk (make-marker)))" " (add-hook 'desktop-delay-hook" " (list 'lambda '() (list 'set-marker mk " " (get-buffer " ")))) mk)" "\"Unprintable entity\"" newlist p q\.txt el last buf pos] 9 (#$ . 5935)])
#@110 Convert VALUE to a string that when read evaluates to the same value.
Not all types of values are supported.
(defalias 'desktop-value-to-string #[(val) "\306\307\310\n!\211@A\f\311=\203 \312P\202 -\207" [print-escape-newlines float-output-format val quote\.txt quote txt t nil desktop-internal-v2s must "'"] 3 (#$ . 7581)])
#@286 Output a setq statement for variable VAR to the desktop file.
The argument VARSPEC may be the variable name VAR (a symbol),
or a cons cell of the form  (VAR . MAX-SIZE),
which means to truncate VAR's value to at most MAX-SIZE elements
(if the value is a list) before saving the value.
(defalias 'desktop-outvar #[(varspec) "\303\211\n:\203 \n@\nA\202 \n\304	!\205? \250\2033 \305V\2033 \306	!<\2033 \307\306	!\"\210\310\311	!\312\313	J!\314\261*\207" [size var varspec nil boundp 0 eval desktop-truncate "(setq " symbol-name " " desktop-value-to-string ")\n"] 5 (#$ . 7922)])
#@168 Return t if the desktop should record a particular buffer for next startup.
FILENAME is the visited file name, BUFNAME is the buffer name, and
MODE is the major mode.
(defalias 'desktop-save-buffer-p #[(filename bufname mode &rest dummy) "\306	\203 \307\n\"\204 \307\f	\"?\2063 \310=\203+ \212\311!q\210\307\f\")?\2063 	?\2053 \312>)\207" [case-fold-search filename desktop-buffers-not-to-save bufname desktop-files-not-to-save mode nil string-match dired-mode get-buffer (Info-mode rmail-mode) default-directory] 3 (#$ . 8516)])
#@76 Save the Desktop file.  Parameter DIRNAME specifies where to save desktop.
(defalias 'desktop-save #[(dirname) "\306\307!\210\212\310	P!\311\312\313 \"\237\314\315!\nq\210\316 \210\317\320 \321\322!\323\324\261\210\311\325\"\"\210\326\">\203D \327\330G#GZ!\331\261\210\332c\210\311\333\"\210$\334\f!\203Y \335\f!\210\336ed\f\337\340%\210,\211%\207" [dirname desktop-basefilename buf info filename desktop-header run-hooks desktop-save-hook expand-file-name mapcar #[(b) "q\210\306 \307 	\n??C`\310\311!D\f	\312=\203  D\2022 	\313=\2052 \314!\315\316\"\237AB\317 \320\211\203r @\236\211\203W B\202h @\235\203h @B)A\211\204A +\257	\207" [b major-mode auto-fill-function mark-active buffer-read-only Info-current-file buffer-file-name buffer-name mark t Info-mode dired-mode expand-file-name mapcar car buffer-local-variables nil Info-current-node dired-directory dired-subdir-alist desktop-locals-to-save ll loclist locals here] 12] buffer-list get-buffer-create "*desktop*" erase-buffer ";; Created " current-time-string "\n" ";; Emacs version " "\n\n" ";; Global section:\n" desktop-outvar kill-ring "(setq kill-ring-yank-pointer (nthcdr " int-to-string " kill-ring))\n" "\n;; Buffer section:\n" #[(l) "\302\303\"\205 	c\210\304\305\"\210\306c\207" [l desktop-create-buffer-form apply desktop-save-buffer-p mapcar #[(e) "\301\302!\261\207" [e "\n  " desktop-value-to-string] 3] ")\n\n"] 3] file-exists-p delete-file write-region nil nomessage emacs-version desktop-globals-to-save kill-ring-yank-pointer default-directory desktop-dirname] 8 (#$ . 9061) "DDirectory to save desktop file in: "])
#@60 Delete the Desktop file and inactivate the desktop system.
(defalias 'desktop-remove #[nil "\205 	P\303\304\n!\205 \305\n!)\207" [desktop-dirname desktop-basefilename filename nil file-exists-p delete-file] 2 (#$ . 10729) nil])
#@104 Read the Desktop file and the files it specifies.
This is a no-op when Emacs is running in batch mode.
(defalias 'desktop-read #[nil "?\205> \305\306\307\n	@\"!\204 	A\211\204 	\205  \307	@!\211\203; \310\307\n\"\311\211\211$\210\312\304!\210\313\314\315!\202= \316 )\207" [noninteractive dirs desktop-basefilename desktop-dirname desktop-delay-hook ("./" "~/") file-exists-p expand-file-name load t run-hooks nil message "Desktop loaded." desktop-clear] 6 (#$ . 10970) nil])
#@165 Load the `default' start-up library manually.
Also inhibit further loading of it.  Call this from your `.emacs' file
to provide correct modes for autoloaded files.
(defalias 'desktop-load-default #[nil "?\205 \301\302\303\211#\210\303\211\207" [inhibit-default-init load "default" t] 4 (#$ . 11461)])
#@20 Load an info file.
(defalias 'desktop-buffer-info #[nil "\302=\205 \303\304!\210\305	@	A@\"\210p\207" [desktop-buffer-major-mode desktop-buffer-misc Info-mode require info Info-find-node] 3 (#$ . 11771)])
#@21 Load an RMAIL file.
(defalias 'desktop-buffer-rmail #[nil "\301=\205\n \302\303\304\217\207" [desktop-buffer-major-mode rmail-mode error (byte-code "\303!\210	\304=\203\f p\207\n\207" [desktop-buffer-file-name major-mode rmail-buffer rmail-input rmail-mode] 2) ((file-locked (byte-code "\300p!\210\301\207" [kill-buffer ignored] 2)))] 3 (#$ . 11984)])
#@33 Load a folder in the mh system.
(defalias 'desktop-buffer-mh #[nil "\302=\205 \303\304!\210\305 \210\306	!\210p\207" [desktop-buffer-major-mode desktop-buffer-name mh-folder-mode require mh-e mh-find-path mh-visit-folder] 2 (#$ . 12344)])
#@31 Load a directory using dired.
(defalias 'desktop-buffer-dired #[nil "\302=\205' \303\304	@!!\203 \305	@!\210\306\307	A\"\210p\207\310\311	@\"\210\312\313!\210\314\207" [desktop-buffer-major-mode desktop-buffer-misc dired-mode file-directory-p file-name-directory dired mapcar dired-insert-subdir message "Directory %s no longer exists." sit-for 1 ignored] 3 (#$ . 12591)])
#@14 Load a file.
(defalias 'desktop-buffer-file #[nil "\205 \302!\204 	\203 \303\304\305\"!\203 \306!\210p\207\307\207" [desktop-buffer-file-name desktop-missing-file-warning file-exists-p y-or-n-p format "File \"%s\" no longer exists. Re-create? " find-file ignored] 4 (#$ . 12972)])
(defalias 'desktop-create-buffer #[(ver desktop-buffer-file-name desktop-buffer-name desktop-buffer-major-mode mim pt mk ro desktop-buffer-misc &optional locals) "\306\211\n\204 \203 @\211 A\202 \307\n!\205\227 \nq\210\310 \f\232\204. \311\f!\210\312@\2038 \313\2029 \314!\210b\210:\203T \315@!\210A@\202Y \315!\210\203b \205\227 @\211:\203\202 \316@!\210@AL\210\202\214 \316!\210\317!\210)A\211\204g \306+\207" [desktop-buffer-handlers handler result hlist desktop-buffer-name mim nil bufferp buffer-name rename-buffer auto-fill-mode 1 0 set-mark make-local-variable makunbound pt mk mark-active ro buffer-read-only locals this] 4])
(defalias 'desktop-buffer #[(desktop-buffer-file-name desktop-buffer-name desktop-buffer-major-mode mim pt mk ro tl fc cfs cr desktop-buffer-misc) "\306\307	\nA\f\310B\311B\312B\313B\314@B\257&\n\207" [desktop-buffer-file-name desktop-buffer-name desktop-buffer-major-mode mim pt mk desktop-create-buffer 205 truncate-lines fill-column case-fold-search case-replace overwrite-mode ro desktop-buffer-misc tl fc cfs cr] 16])
(byte-code "\300\301\302\"\210\303\304!\207" [add-hook after-init-hook (lambda nil (when desktop-enable (desktop-load-default) (desktop-read))) provide desktop] 3)
