annotate lisp/packages/desktop.el @ 36:c53a95d3c46d r19-15b101

Import from CVS: tag r19-15b101
author cvs
date Mon, 13 Aug 2007 08:53:38 +0200
parents ac2d302a0011
children 34a5b81f86ba
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;;; desktop.el --- save partial status of Emacs when killed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;; Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; Author: Morten Welinder <terra@diku.dk>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; Version: 2.09? RMS has an obnoxious tendency to remove version
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;; numbers from packages, and he did in this case.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;; Keywords: customization
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;; Favourite-brand-of-beer: None, I hate beer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;; XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; XEmacs is distributed in the hope that it will be useful, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;; General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;; You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;; along with XEmacs; see the file COPYING. If not, write to the Free
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
25 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
26 ;; 02111-1307, USA.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
28 ;;; Synched up with: FSF 19.34.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 ;;; Commentary:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 ;; Save the Desktop, i.e.,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 ;; - some global variables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 ;; - the list of buffers with associated files. For each buffer also
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 ;; - the major mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 ;; - the default directory
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 ;; - the point
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 ;; - the mark & mark-active
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 ;; - buffer-read-only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 ;; - some local variables
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 ;; To use this, first put these three lines in the bottom of your .emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 ;; file (the later the better):
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 ;; (load "desktop")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 ;; (desktop-load-default)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 ;; (desktop-read)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 ;; Between the second and the third line you may wish to add something that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 ;; updates the variables `desktop-globals-to-save' and/or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 ;; `desktop-locals-to-save'. If for instance you want to save the local
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 ;; variable `foobar' for every buffer in which it is local, you could add
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 ;; the line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 ;; (setq desktop-locals-to-save (cons 'foobar desktop-locals-to-save))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 ;; To avoid saving excessive amounts of data you may also wish to add
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 ;; something like the following
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 ;; (add-hook 'kill-emacs-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 ;; '(lambda ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 ;; (desktop-truncate search-ring 3)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 ;; (desktop-truncate regexp-search-ring 3)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 ;; which will make sure that no more than three search items are saved. You
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 ;; must place this line *after* the (load "desktop") line. See also the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 ;; variable desktop-save-hook.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 ;; Start Emacs in the root directory of your "project". The desktop saver
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 ;; is inactive by default. You activate it by M-x desktop-save RET. When
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 ;; you exit the next time the above data will be saved. This ensures that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 ;; all the files you were editing will be reloaded the next time you start
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 ;; Emacs from the same directory and that points will be set where you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 ;; left them. If you save a desktop file in your home directory it will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 ;; act as a default desktop when you start Emacs from a directory that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 ;; doesn't have its own. I never do this, but you may want to.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 ;; By the way: don't use desktop.el to customize Emacs -- the file .emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 ;; in your home directory is used for that. Saving global default values
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 ;; for buffers is an example of misuse.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 ;; PLEASE NOTE: The kill ring can be saved as specified by the variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 ;; `desktop-globals-to-save' (by default it isn't). This may result in saving
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 ;; things you did not mean to keep. Use M-x desktop-clear RET.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 ;; Thanks to hetrick@phys.uva.nl (Jim Hetrick) for useful ideas.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 ;; avk@rtsg.mot.com (Andrew V. Klein) for a dired tip.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 ;; chris@tecc.co.uk (Chris Boucher) for a mark tip.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 ;; f89-kam@nada.kth.se (Klas Mellbourn) for a mh-e tip.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 ;; kifer@sbkifer.cs.sunysb.edu (M. Kifer) for a bug hunt.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 ;; treese@lcs.mit.edu (Win Treese) for ange-ftp tips.
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
92 ;; pot@cnuce.cnr.it (Francesco Potorti`) for misc. tips.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 ;; ---------------------------------------------------------------------------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 ;; TODO:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 ;; Save window configuration.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 ;; Recognize more minor modes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 ;; Save mark rings.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 ;; Start-up with buffer-menu???
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 ;;; Code:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 ;; Make the compilation more silent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 (eval-when-compile
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 ;; We use functions from these modules
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 ;; We can't (require 'mh-e) since that wants to load something.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 (mapcar 'require '(info dired reporter)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 ;; ----------------------------------------------------------------------------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 ;; USER OPTIONS -- settings you might want to play with.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 ;; ----------------------------------------------------------------------------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 (defconst desktop-basefilename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 (if (or (eq system-type 'ms-dos) (eq system-type 'windows-nt))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 "emacs.dsk" ; Ms-Dos does not support multiple dots in file name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 ".emacs.desktop")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 "File for Emacs desktop, not including the directory name.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 (defvar desktop-missing-file-warning t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 "*If non-nil then desktop warns when a file no longer exists.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 Otherwise it simply ignores that file.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 (defvar desktop-globals-to-save
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 (list 'desktop-missing-file-warning
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 ;; Feature: saving kill-ring implies saving kill-ring-yank-pointer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 ;; 'kill-ring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 'tags-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 'tags-table-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 'search-ring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 'regexp-search-ring
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 'register-alist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 ;; 'desktop-globals-to-save ; Itself!
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 "List of global variables to save when killing Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 An element may be variable name (a symbol)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 or a cons cell of the form (VAR . MAX-SIZE),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 which means to truncate VAR's value to at most MAX-SIZE elements
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136 \(if the value is a list) before saving the value.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 (defvar desktop-locals-to-save
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 (list 'desktop-locals-to-save ; Itself! Think it over.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 'truncate-lines
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 'case-fold-search
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 'case-replace
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 'fill-column
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 'overwrite-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 'change-log-default-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 'line-number-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 "List of local variables to save for each buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 The variables are saved only when they really are local.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 (make-variable-buffer-local 'desktop-locals-to-save)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152 ;; We skip .log files because they are normally temporary.
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
153 ;; (ftp) files because they require passwords and whatnot.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 ;; TAGS files to save time (tags-file-name is saved instead).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155 (defvar desktop-buffers-not-to-save
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 "\\(^nn\\.a[0-9]+\\|\\.log\\|(ftp)\\|^tags\\|^TAGS\\)$"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157 "Regexp identifying buffers that are to be excluded from saving.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 ;; Skip ange-ftp files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 (defvar desktop-files-not-to-save
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 "^/[^/:]*:"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 "Regexp identifying files whose buffers are to be excluded from saving.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
164 (defvar desktop-buffer-major-mode nil
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
165 "When desktop creates a buffer, this holds the desired Major mode.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
166
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
167 (defvar desktop-buffer-file-name nil
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
168 "When desktop creates a buffer, this holds the file name to visit.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
169
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
170 (defvar desktop-buffer-name nil
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
171 "When desktop creates a buffer, this holds the desired buffer name.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
172
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
173 (defvar desktop-buffer-misc nil
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
174 "When desktop creates a buffer, this holds a list of misc info.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
175 It is used by the `desktop-buffer-handlers' functions.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
176
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 (defvar desktop-buffer-handlers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 '(desktop-buffer-dired
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 desktop-buffer-rmail
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 desktop-buffer-mh
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 desktop-buffer-info
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 desktop-buffer-file)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 "*List of functions to call in order to create a buffer.
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
184 The functions are called without explicit parameters but can use the
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
185 variables `desktop-buffer-major-mode', `desktop-buffer-file-name',
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
186 `desktop-buffer-name'.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
187 If one function returns non-nil, no further functions are called.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
188 If the function returns t then the buffer is considered created.")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 (defvar desktop-create-buffer-form "(desktop-create-buffer 205"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 "Opening of form for creation of new buffers.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 (defvar desktop-save-hook nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 "Hook run before saving the desktop to allow you to cut history lists and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 the like shorter.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 ;; ----------------------------------------------------------------------------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 (defvar desktop-dirname nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 "The directory in which the current desktop file resides.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 (defconst desktop-header
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 ";; --------------------------------------------------------------------------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 ;; Desktop File for Emacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 ;; --------------------------------------------------------------------------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 " "*Header to place in Desktop file.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 (defvar desktop-delay-hook nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 "Hooks run after all buffers are loaded; intended for internal use.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 ;; ----------------------------------------------------------------------------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 (defun desktop-truncate (l n)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 "Truncate LIST to at most N elements destructively."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 (let ((here (nthcdr (1- n) l)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 (if (consp here)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 (setcdr here nil))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 ;; ----------------------------------------------------------------------------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 (defun desktop-clear () "Empty the Desktop."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 (setq kill-ring nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 kill-ring-yank-pointer nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 search-ring nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 search-ring-yank-pointer nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 regexp-search-ring nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 regexp-search-ring-yank-pointer nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 (mapcar (function (lambda (x)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 ;; XEmacs change
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 (if (not (equal (buffer-name x) "*Warnings*"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 (kill-buffer x)))) (buffer-list))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 (delete-other-windows))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 ;; ----------------------------------------------------------------------------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 (add-hook 'kill-emacs-hook 'desktop-kill)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231 (defun desktop-kill ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 (if desktop-dirname
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 (condition-case err
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 (desktop-save desktop-dirname)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 (file-error
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 (if (yes-or-no-p "Error while saving the desktop. Quit anyway? ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 (signal (car err) (cdr err)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 ;; ----------------------------------------------------------------------------
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
240 (defun desktop-list* (&rest args)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
241 (if (null (cdr args))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
242 (car args)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
243 (setq args (nreverse args))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
244 (let ((value (cons (nth 1 args) (car args))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
245 (setq args (cdr (cdr args)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
246 (while args
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
247 (setq value (cons (car args) value))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
248 (setq args (cdr args)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
249 value)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
250
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 (defun desktop-internal-v2s (val)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 "Convert VALUE to a pair (QUOTE . TXT); (eval (read TXT)) gives VALUE.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 TXT is a string that when read and evaluated yields value.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 QUOTE may be `may' (value may be quoted),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 `must' (values must be quoted), or nil (value may not be quoted)."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 ((or (numberp val) (null val) (eq t val))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 (cons 'may (prin1-to-string val)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 ((stringp val)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 (let ((copy (copy-sequence val)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 (set-text-properties 0 (length copy) nil copy)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 ;; Get rid of text properties because we cannot read them
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 (cons 'may (prin1-to-string copy))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 ((symbolp val)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 (cons 'must (prin1-to-string val)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 ((vectorp val)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 (let* ((special nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 (pass1 (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 (lambda (el)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 (let ((res (desktop-internal-v2s el)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 (if (null (car res))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 (setq special t))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 res))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 val)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 (if special
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 (cons nil (concat "(vector "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 (mapconcat (lambda (el)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 (if (eq (car el) 'must)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 (concat "'" (cdr el))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 (cdr el)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 pass1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 " ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 ")"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 (cons 'may (concat "[" (mapconcat 'cdr pass1 " ") "]")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 ((consp val)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 (let ((p val)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 newlist
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
288 use-list*
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 anynil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 (while (consp p)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 (let ((q.txt (desktop-internal-v2s (car p))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 (or anynil (setq anynil (null (car q.txt))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 (setq newlist (cons q.txt newlist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 (setq p (cdr p)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 (if p
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 (let ((last (desktop-internal-v2s p))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 (el (car newlist)))
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
298 (or anynil (setq anynil (null (car last))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
299 (or anynil
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
300 (setq newlist (cons '(must . ".") newlist)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
301 (setq use-list* t)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
302 (setq newlist (cons last newlist))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 (setq newlist (nreverse newlist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 (if anynil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 (cons nil
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
306 (concat (if use-list* "(desktop-list* " "(list ")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307 (mapconcat (lambda (el)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 (if (eq (car el) 'must)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 (concat "'" (cdr el))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310 (cdr el)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 newlist
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 " ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 ")"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 (cons 'must
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315 (concat "(" (mapconcat 'cdr newlist " ") ")")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 ((subrp val)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 (cons nil (concat "(symbol-function '"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318 (substring (prin1-to-string val) 7 -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 ")")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 ((markerp val)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 (let ((pos (prin1-to-string (marker-position val)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322 (buf (prin1-to-string (buffer-name (marker-buffer val)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 (cons nil (concat "(let ((mk (make-marker)))"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 " (add-hook 'desktop-delay-hook"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 " (list 'lambda '() (list 'set-marker mk "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326 pos " (get-buffer " buf ")))) mk)"))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 (t ; save as text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 (cons 'may "\"Unprintable entity\""))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 (defun desktop-value-to-string (val)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 "Convert VALUE to a string that when read evaluates to the same value.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 Not all types of values are supported."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 (let* ((print-escape-newlines t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 (float-output-format nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 (quote.txt (desktop-internal-v2s val))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 (quote (car quote.txt))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 (txt (cdr quote.txt)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 (if (eq quote 'must)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 (concat "'" txt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 txt)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 ;; ----------------------------------------------------------------------------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 (defun desktop-outvar (varspec)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343 "Output a setq statement for variable VAR to the desktop file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 The argument VARSPEC may be the variable name VAR (a symbol),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 or a cons cell of the form (VAR . MAX-SIZE),
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 which means to truncate VAR's value to at most MAX-SIZE elements
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347 \(if the value is a list) before saving the value."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 (let (var size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 (if (consp varspec)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350 (setq var (car varspec) size (cdr varspec))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 (setq var varspec))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 (if (boundp var)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 (if (and (integerp size)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 (> size 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356 (listp (eval var)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 (desktop-truncate (eval var) size))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 (insert "(setq "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 (symbol-name var)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 " "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 (desktop-value-to-string (symbol-value var))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 ")\n")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 ;; ----------------------------------------------------------------------------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 (defun desktop-save-buffer-p (filename bufname mode &rest dummy)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 "Return t if the desktop should record a particular buffer for next startup.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 FILENAME is the visited file name, BUFNAME is the buffer name, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 MODE is the major mode."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 (let ((case-fold-search nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 (or (and filename
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370 (not (string-match desktop-buffers-not-to-save bufname))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371 (not (string-match desktop-files-not-to-save filename)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 (and (eq mode 'dired-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 (set-buffer (get-buffer bufname))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 (not (string-match desktop-files-not-to-save
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 default-directory))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377 (and (null filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 (memq mode '(Info-mode rmail-mode))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379 ;; ----------------------------------------------------------------------------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380 (defun desktop-save (dirname)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 "Save the Desktop file. Parameter DIRNAME specifies where to save desktop."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 (interactive "DDirectory to save desktop file in: ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383 (run-hooks 'desktop-save-hook)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 (let ((filename (expand-file-name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386 (concat dirname desktop-basefilename)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 (info (nreverse
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388 (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 (function (lambda (b)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390 (set-buffer b)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391 (list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 (buffer-file-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393 (buffer-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 major-mode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395 (list ; list explaining minor modes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 (not (null auto-fill-function)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397 (point)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 (list (mark t) ;; mark-active
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 (not (null (mark)))) ; XEmacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 buffer-read-only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 (cond ((eq major-mode 'Info-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 (list Info-current-file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403 Info-current-node))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 ((eq major-mode 'dired-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405 (cons
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 (expand-file-name dired-directory)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 (cdr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408 (nreverse
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 (function car)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 dired-subdir-alist))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 (let ((locals desktop-locals-to-save)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 (loclist (buffer-local-variables))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 (ll))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415 (while locals
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 (let ((here (assq (car locals) loclist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 (if here
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418 (setq ll (cons here ll))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419 (if (member (car locals) loclist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 (setq ll (cons (car locals) ll)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 (setq locals (cdr locals)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 ll)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423 )))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 (buffer-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425 (buf (get-buffer-create "*desktop*")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426 (set-buffer buf)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 (erase-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 (insert desktop-header
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430 ";; Created " (current-time-string) "\n"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 ";; Emacs version " emacs-version "\n\n"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 ";; Global section:\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 (mapcar (function desktop-outvar) desktop-globals-to-save)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434 (if (memq 'kill-ring desktop-globals-to-save)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 (insert "(setq kill-ring-yank-pointer (nthcdr "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 (int-to-string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 (- (length kill-ring) (length kill-ring-yank-pointer)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438 " kill-ring))\n"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 (insert "\n;; Buffer section:\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 (function (lambda (l)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443 (if (apply 'desktop-save-buffer-p l)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 (insert desktop-create-buffer-form)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446 (mapcar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447 (function (lambda (e)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 (insert "\n "
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 (desktop-value-to-string e))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450 l)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 (insert ")\n\n")))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452 info)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 (setq default-directory dirname)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454 (if (file-exists-p filename) (delete-file filename))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455 (write-region (point-min) (point-max) filename nil 'nomessage)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 (setq desktop-dirname dirname))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 ;; ----------------------------------------------------------------------------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458 (defun desktop-remove ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459 "Delete the Desktop file and inactivate the desktop system."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 (if desktop-dirname
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462 (let ((filename (concat desktop-dirname desktop-basefilename)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463 (setq desktop-dirname nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464 (if (file-exists-p filename)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 (delete-file filename)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466 ;; ----------------------------------------------------------------------------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467 (defun desktop-read ()
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
468 "Read the Desktop file and the files it specifies.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
469 This is a no-op when Emacs is running in batch mode."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 (interactive)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
471 (if noninteractive
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
472 nil
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
473 (let ((dirs '("./" "~/")))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
474 (while (and dirs
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
475 (not (file-exists-p (expand-file-name
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
476 desktop-basefilename
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
477 (car dirs)))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
478 (setq dirs (cdr dirs)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
479 (setq desktop-dirname (and dirs (expand-file-name (car dirs))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
480 (if desktop-dirname
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
481 (progn
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
482 (load (expand-file-name desktop-basefilename desktop-dirname)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
483 t t t)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
484 (run-hooks 'desktop-delay-hook)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
485 (setq desktop-delay-hook nil)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
486 (message "Desktop loaded."))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
487 (desktop-clear)))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 ;; ----------------------------------------------------------------------------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489 (defun desktop-load-default ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 "Load the `default' start-up library manually.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491 Also inhibit further loading of it. Call this from your `.emacs' file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 to provide correct modes for autoloaded files."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493 (if (not inhibit-default-init) ; safety check
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495 (load "default" t t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 (setq inhibit-default-init t))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497 ;; ----------------------------------------------------------------------------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 ;; Note: the following functions use the dynamic variable binding in Lisp.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 (defun desktop-buffer-info () "Load an info file."
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
501 (if (eq 'Info-mode desktop-buffer-major-mode)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503 (require 'info)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
504 (Info-find-node (nth 0 desktop-buffer-misc)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
505 (nth 1 desktop-buffer-misc))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506 t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 ;; ----------------------------------------------------------------------------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508 (defun desktop-buffer-rmail () "Load an RMAIL file."
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
509 (if (eq 'rmail-mode desktop-buffer-major-mode)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510 (condition-case error
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
511 (progn (rmail-input desktop-buffer-file-name) t)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512 (file-locked
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513 (kill-buffer (current-buffer))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514 'ignored))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515 ;; ----------------------------------------------------------------------------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 (defun desktop-buffer-mh () "Load a folder in the mh system."
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
517 (if (eq 'mh-folder-mode desktop-buffer-major-mode)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519 (require 'mh-e)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 (mh-find-path)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
521 (mh-visit-folder desktop-buffer-name)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522 t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 ;; ----------------------------------------------------------------------------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524 (defun desktop-buffer-dired () "Load a directory using dired."
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
525 (if (eq 'dired-mode desktop-buffer-major-mode)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
526 (if (file-directory-p (file-name-directory (car desktop-buffer-misc)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527 (progn
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
528 (dired (car desktop-buffer-misc))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
529 (mapcar 'dired-insert-subdir (cdr desktop-buffer-misc))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530 t)
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
531 (message "Directory %s no longer exists." (car desktop-buffer-misc))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532 (sit-for 1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 'ignored)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534 ;; ----------------------------------------------------------------------------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 (defun desktop-buffer-file () "Load a file."
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
536 (if desktop-buffer-file-name
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
537 (if (or (file-exists-p desktop-buffer-file-name)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 (and desktop-missing-file-warning
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539 (y-or-n-p (format
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 "File \"%s\" no longer exists. Re-create? "
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
541 desktop-buffer-file-name))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
542 (progn (find-file desktop-buffer-file-name) t)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 'ignored)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 ;; ----------------------------------------------------------------------------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 ;; Create a buffer, load its file, set is mode, ...; called from Desktop file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 ;; only.
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
547 (defun desktop-create-buffer (ver desktop-buffer-file-name desktop-buffer-name
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
548 desktop-buffer-major-mode
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
549 mim pt mk ro desktop-buffer-misc
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
550 &optional locals)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 (let ((hlist desktop-buffer-handlers)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 (result)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 (handler))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554 (while (and (not result) hlist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 (setq handler (car hlist))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 (setq result (funcall handler))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557 (setq hlist (cdr hlist)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 (if (eq result t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559 (progn
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
560 (if (not (equal (buffer-name) desktop-buffer-name))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
561 (rename-buffer desktop-buffer-name))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562 (auto-fill-mode (if (nth 0 mim) 1 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563 (goto-char pt)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 (if (consp mk)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566 (set-mark (car mk))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567 ;; (setq mark-active (car (cdr mk))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568 (if (car (cdr mk)) (zmacs-activate-region))) ; XEmacs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569 (set-mark mk))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570 ;; Never override file system if the file really is read-only marked.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571 (if ro (setq buffer-read-only ro))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572 (while locals
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573 (let ((this (car locals)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574 (if (consp this)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575 ;; an entry of this form `(symbol . value)'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577 (make-local-variable (car this))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578 (set (car this) (cdr this)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
579 ;; an entry of the form `symbol'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
580 (make-local-variable this)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
581 (makunbound this)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
582 (setq locals (cdr locals)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
583 ))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
584
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
585 ;; Backward compatibility -- update parameters to 205 standards.
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
586 (defun desktop-buffer (desktop-buffer-file-name desktop-buffer-name
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
587 desktop-buffer-major-mode
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
588 mim pt mk ro tl fc cfs cr
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
589 desktop-buffer-misc)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
590 (desktop-create-buffer 205 desktop-buffer-file-name desktop-buffer-name
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
591 desktop-buffer-major-mode (cdr mim) pt mk ro
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
592 desktop-buffer-misc
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
593 (list (cons 'truncate-lines tl)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
594 (cons 'fill-column fc)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
595 (cons 'case-fold-search cfs)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
596 (cons 'case-replace cr)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
597 (cons 'overwrite-mode (car mim)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
598 ;; ----------------------------------------------------------------------------
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
599 (provide 'desktop)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
600
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
601 ;; desktop.el ends here.