Mercurial > emacs
comparison lisp/desktop.el @ 10595:06fa5b312280
Many doc fixes.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Mon, 30 Jan 1995 06:14:33 +0000 |
parents | b25efd6c4f30 |
children | 9f4a9820fea1 |
comparison
equal
deleted
inserted
replaced
10594:aadef46f00f7 | 10595:06fa5b312280 |
---|---|
105 ;; ---------------------------------------------------------------------------- | 105 ;; ---------------------------------------------------------------------------- |
106 (defconst desktop-basefilename | 106 (defconst desktop-basefilename |
107 (if (or (eq system-type 'ms-dos) (eq system-type 'windows-nt)) | 107 (if (or (eq system-type 'ms-dos) (eq system-type 'windows-nt)) |
108 "emacs.dsk" ; Ms-Dos does not support multiple dots in file name | 108 "emacs.dsk" ; Ms-Dos does not support multiple dots in file name |
109 ".emacs.desktop") | 109 ".emacs.desktop") |
110 "File for Emacs desktop. A directory name will be prepended to this name.") | 110 "File for Emacs desktop, not including the directory name.") |
111 | 111 |
112 (defvar desktop-missing-file-warning t | 112 (defvar desktop-missing-file-warning t |
113 "*If non-nil then issue warning if a file no longer exists. | 113 "*If non-nil then desktop warns when a file no longer exists. |
114 Otherwise simply ignore the file.") | 114 Otherwise it simply ignores that file.") |
115 | 115 |
116 (defvar desktop-globals-to-save | 116 (defvar desktop-globals-to-save |
117 (list 'desktop-missing-file-warning | 117 (list 'desktop-missing-file-warning |
118 ;; Feature: saving kill-ring implies saving kill-ring-yank-pointer | 118 ;; Feature: saving kill-ring implies saving kill-ring-yank-pointer |
119 ;; 'kill-ring | 119 ;; 'kill-ring |
134 'fill-column | 134 'fill-column |
135 'overwrite-mode | 135 'overwrite-mode |
136 'change-log-default-name | 136 'change-log-default-name |
137 'line-number-mode | 137 'line-number-mode |
138 ) | 138 ) |
139 "List of local variables to save for each buffer. The variables are saved | 139 "List of local variables to save for each buffer. |
140 only when they really are local.") | 140 The variables are saved only when they really are local.") |
141 (make-variable-buffer-local 'desktop-locals-to-save) | 141 (make-variable-buffer-local 'desktop-locals-to-save) |
142 | 142 |
143 ;; We skip .log files because they are normally temporary. | 143 ;; We skip .log files because they are normally temporary. |
144 ;; (ftp) files because they require passwords and whatsnot. | 144 ;; (ftp) files because they require passwords and whatsnot. |
145 ;; TAGS files to save time (tags-file-name is saved instead). | 145 ;; TAGS files to save time (tags-file-name is saved instead). |
156 '(desktop-buffer-dired | 156 '(desktop-buffer-dired |
157 desktop-buffer-rmail | 157 desktop-buffer-rmail |
158 desktop-buffer-mh | 158 desktop-buffer-mh |
159 desktop-buffer-info | 159 desktop-buffer-info |
160 desktop-buffer-file) | 160 desktop-buffer-file) |
161 "*List of functions to call in order to create a buffer. The functions are | 161 "*List of functions to call in order to create a buffer. |
162 called without explicit parameters but may access the the major mode as `mam', | 162 The functions are called without explicit parameters but may access |
163 the file name as `fn', the buffer name as `bn', the default directory as | 163 the the major mode as `mam', the file name as `fn', the buffer name as |
164 `dd'. If some function returns non-nil no further functions are called. | 164 `bn', the default directory as `dd'. If some function returns non-nil |
165 If the function returns t then the buffer is considered created.") | 165 no further functions are called. If the function returns t then the |
166 buffer is considered created.") | |
166 | 167 |
167 (defvar desktop-create-buffer-form "(desktop-create-buffer 205" | 168 (defvar desktop-create-buffer-form "(desktop-create-buffer 205" |
168 "Opening of form for creation of new buffers.") | 169 "Opening of form for creation of new buffers.") |
169 | 170 |
170 (defvar desktop-save-hook nil | 171 (defvar desktop-save-hook nil |
210 (if (yes-or-no-p "Error while saving the desktop. Quit anyway? ") | 211 (if (yes-or-no-p "Error while saving the desktop. Quit anyway? ") |
211 nil | 212 nil |
212 (signal (car err) (cdr err))))))) | 213 (signal (car err) (cdr err))))))) |
213 ;; ---------------------------------------------------------------------------- | 214 ;; ---------------------------------------------------------------------------- |
214 (defun desktop-internal-v2s (val) | 215 (defun desktop-internal-v2s (val) |
215 "Convert VALUE to a pair (quote . txt) where txt is a string that when read | 216 "Convert VALUE to a pair (QUOTE . TXT); (eval (read TXT)) gives VALUE. |
216 and evaluated yields value. quote may be 'may (value may be quoted), | 217 TXT is a string that when read and evaluated yields value. |
217 'must (values must be quoted), or nil (value may not be quoted)." | 218 QUOTE may be `may' (value may be quoted), |
219 `must' (values must be quoted), or nil (value may not be quoted)." | |
218 (cond | 220 (cond |
219 ((or (numberp val) (null val) (eq t val)) | 221 ((or (numberp val) (null val) (eq t val)) |
220 (cons 'may (prin1-to-string val))) | 222 (cons 'may (prin1-to-string val))) |
221 ((stringp val) | 223 ((stringp val) |
222 ;; Get rid of text properties because we cannot read them | 224 ;; Get rid of text properties because we cannot read them |
292 pos " (get-buffer " buf ")))) mk)")))) | 294 pos " (get-buffer " buf ")))) mk)")))) |
293 (t ; save as text | 295 (t ; save as text |
294 (cons 'may "\"Unprintable entity\"")))) | 296 (cons 'may "\"Unprintable entity\"")))) |
295 | 297 |
296 (defun desktop-value-to-string (val) | 298 (defun desktop-value-to-string (val) |
297 "Convert VALUE to a string that when read evaluates to the same value. Not | 299 "Convert VALUE to a string that when read evaluates to the same value. |
298 all types of values are supported." | 300 Not all types of values are supported." |
299 (let* ((print-escape-newlines t) | 301 (let* ((print-escape-newlines t) |
300 (float-output-format nil) | 302 (float-output-format nil) |
301 (quote.txt (desktop-internal-v2s val)) | 303 (quote.txt (desktop-internal-v2s val)) |
302 (quote (car quote.txt)) | 304 (quote (car quote.txt)) |
303 (txt (cdr quote.txt))) | 305 (txt (cdr quote.txt))) |
429 (run-hooks 'desktop-delay-hook) | 431 (run-hooks 'desktop-delay-hook) |
430 (message "Desktop loaded.")) | 432 (message "Desktop loaded.")) |
431 (desktop-clear)))) | 433 (desktop-clear)))) |
432 ;; ---------------------------------------------------------------------------- | 434 ;; ---------------------------------------------------------------------------- |
433 (defun desktop-load-default () | 435 (defun desktop-load-default () |
434 "Load the `default' start-up library manually. Also inhibit further loading | 436 "Load the `default' start-up library manually. |
435 of it. Call this from your `.emacs' file to provide correct modes for | 437 Also inhibit further loading of it. Call this from your `.emacs' file |
436 autoloaded files." | 438 to provide correct modes for autoloaded files." |
437 (if (not inhibit-default-init) ; safety check | 439 (if (not inhibit-default-init) ; safety check |
438 (progn | 440 (progn |
439 (load "default" t t) | 441 (load "default" t t) |
440 (setq inhibit-default-init t)))) | 442 (setq inhibit-default-init t)))) |
441 ;; ---------------------------------------------------------------------------- | 443 ;; ---------------------------------------------------------------------------- |