comparison lisp/desktop.el @ 17411:f0ff96a35eb8

Add defgroup's; use defcustom for user vars.
author Richard M. Stallman <rms@gnu.org>
date Sat, 12 Apr 1997 03:18:33 +0000
parents 2c684820d196
children bb491744ccd7
comparison
equal deleted inserted replaced
17410:777a31320b0f 17411:f0ff96a35eb8
102 ;; We can't (require 'mh-e) since that wants to load something. 102 ;; We can't (require 'mh-e) since that wants to load something.
103 (mapcar 'require '(info dired reporter))) 103 (mapcar 'require '(info dired reporter)))
104 ;; ---------------------------------------------------------------------------- 104 ;; ----------------------------------------------------------------------------
105 ;; USER OPTIONS -- settings you might want to play with. 105 ;; USER OPTIONS -- settings you might want to play with.
106 ;; ---------------------------------------------------------------------------- 106 ;; ----------------------------------------------------------------------------
107
108 (defgroup desktop nil
109 "Save status of Emacs when you exit."
110 :group 'frames)
111
107 (defconst desktop-basefilename 112 (defconst desktop-basefilename
108 (convert-standard-filename ".emacs.desktop") 113 (convert-standard-filename ".emacs.desktop")
109 "File for Emacs desktop, not including the directory name.") 114 "File for Emacs desktop, not including the directory name.")
110 115
111 (defvar desktop-missing-file-warning nil 116 (defcustom desktop-missing-file-warning nil
112 "*If non-nil then desktop warns when a file no longer exists. 117 "*If non-nil then desktop warns when a file no longer exists.
113 Otherwise it simply ignores that file.") 118 Otherwise it simply ignores that file."
119 :type 'boolean
120 :group 'desktop)
114 121
115 (defvar desktop-globals-to-save 122 (defvar desktop-globals-to-save
116 (list 'desktop-missing-file-warning 123 (list 'desktop-missing-file-warning
117 ;; Feature: saving kill-ring implies saving kill-ring-yank-pointer 124 ;; Feature: saving kill-ring implies saving kill-ring-yank-pointer
118 ;; 'kill-ring 125 ;; 'kill-ring
144 (make-variable-buffer-local 'desktop-locals-to-save) 151 (make-variable-buffer-local 'desktop-locals-to-save)
145 152
146 ;; We skip .log files because they are normally temporary. 153 ;; We skip .log files because they are normally temporary.
147 ;; (ftp) files because they require passwords and whatnot. 154 ;; (ftp) files because they require passwords and whatnot.
148 ;; TAGS files to save time (tags-file-name is saved instead). 155 ;; TAGS files to save time (tags-file-name is saved instead).
149 (defvar desktop-buffers-not-to-save 156 (defcustom desktop-buffers-not-to-save
150 "\\(^nn\\.a[0-9]+\\|\\.log\\|(ftp)\\|^tags\\|^TAGS\\)$" 157 "\\(^nn\\.a[0-9]+\\|\\.log\\|(ftp)\\|^tags\\|^TAGS\\)$"
151 "Regexp identifying buffers that are to be excluded from saving.") 158 "Regexp identifying buffers that are to be excluded from saving."
159 :type 'regexp
160 :group 'desktop)
152 161
153 ;; Skip ange-ftp files 162 ;; Skip ange-ftp files
154 (defvar desktop-files-not-to-save 163 (defcustom desktop-files-not-to-save
155 "^/[^/:]*:" 164 "^/[^/:]*:"
156 "Regexp identifying files whose buffers are to be excluded from saving.") 165 "Regexp identifying files whose buffers are to be excluded from saving."
157 166 :type 'regexp
158 (defvar desktop-buffer-major-mode nil 167 :group 'desktop)
159 "When desktop creates a buffer, this holds the desired Major mode.") 168
160 169 (defcustom desktop-buffer-major-mode nil
161 (defvar desktop-buffer-file-name nil 170 "When desktop creates a buffer, this holds the desired Major mode."
162 "When desktop creates a buffer, this holds the file name to visit.") 171 :type 'symbol
163 172 :group 'desktop)
164 (defvar desktop-buffer-name nil 173
165 "When desktop creates a buffer, this holds the desired buffer name.") 174 (defcustom desktop-buffer-file-name nil
175 "When desktop creates a buffer, this holds the file name to visit."
176 :type '(choice file (const nil))
177 :group 'desktop)
178
179 (defcustom desktop-buffer-name nil
180 "When desktop creates a buffer, this holds the desired buffer name."
181 :type '(choice string (const nil))
182 :group 'desktop)
166 183
167 (defvar desktop-buffer-misc nil 184 (defvar desktop-buffer-misc nil
168 "When desktop creates a buffer, this holds a list of misc info. 185 "When desktop creates a buffer, this holds a list of misc info.
169 It is used by the `desktop-buffer-handlers' functions.") 186 It is used by the `desktop-buffer-handlers' functions.")
170 187
171 (defvar desktop-buffer-handlers 188 (defcustom desktop-buffer-handlers
172 '(desktop-buffer-dired 189 '(desktop-buffer-dired
173 desktop-buffer-rmail 190 desktop-buffer-rmail
174 desktop-buffer-mh 191 desktop-buffer-mh
175 desktop-buffer-info 192 desktop-buffer-info
176 desktop-buffer-file) 193 desktop-buffer-file)
177 "*List of functions to call in order to create a buffer. 194 "*List of functions to call in order to create a buffer.
178 The functions are called without explicit parameters but can use the 195 The functions are called without explicit parameters but can use the
179 variables `desktop-buffer-major-mode', `desktop-buffer-file-name', 196 variables `desktop-buffer-major-mode', `desktop-buffer-file-name',
180 `desktop-buffer-name'. 197 `desktop-buffer-name'.
181 If one function returns non-nil, no further functions are called. 198 If one function returns non-nil, no further functions are called.
182 If the function returns t then the buffer is considered created.") 199 If the function returns t then the buffer is considered created."
200 :type '(repeat function)
201 :group 'desktop)
183 202
184 (defvar desktop-create-buffer-form "(desktop-create-buffer 205" 203 (defvar desktop-create-buffer-form "(desktop-create-buffer 205"
185 "Opening of form for creation of new buffers.") 204 "Opening of form for creation of new buffers.")
186 205
187 (defvar desktop-save-hook nil 206 (defcustom desktop-save-hook nil
188 "Hook run before saving the desktop to allow you to cut history lists and 207 "Hook run before saving the desktop to allow you to cut history lists and
189 the like shorter.") 208 the like shorter."
209 :type 'hook
210 :group 'desktop)
190 ;; ---------------------------------------------------------------------------- 211 ;; ----------------------------------------------------------------------------
191 (defvar desktop-dirname nil 212 (defvar desktop-dirname nil
192 "The directory in which the current desktop file resides.") 213 "The directory in which the current desktop file resides.")
193 214
194 (defconst desktop-header 215 (defconst desktop-header