aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Hansen2004-09-09 19:45:03 +0000
committerLars Hansen2004-09-09 19:45:03 +0000
commit340db502fa63af19824db898fec3fd7c6ba5ce0c (patch)
treefbd53401670b0095abf6bc37d4a07f94ca2db307
parent64b7122d05513fedddb5d7441d0659a10b18861a (diff)
downloademacs-340db502fa63af19824db898fec3fd7c6ba5ce0c.tar.gz
emacs-340db502fa63af19824db898fec3fd7c6ba5ce0c.zip
(desktop-clear-preserve-buffers): Remove make-obsolete-variable.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/desktop.el168
2 files changed, 84 insertions, 89 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 0d9e7b45e24..b97cc4675db 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12004-09-09 Lars Hansen <larsh@math.ku.dk>
2
3 * desktop.el (desktop-clear-preserve-buffers): Remove
4 make-obsolete-variable.
5
12004-09-08 Stefan <monnier@iro.umontreal.ca> 62004-09-08 Stefan <monnier@iro.umontreal.ca>
2 7
3 * vc-arch.el (vc-arch-state): Fix parsing for `names' method. 8 * vc-arch.el (vc-arch-state): Fix parsing for `names' method.
diff --git a/lisp/desktop.el b/lisp/desktop.el
index 3888262f02f..64e8770ffd0 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -171,13 +171,13 @@ This is useful for truncating history lists, for example."
171 :type 'hook 171 :type 'hook
172 :group 'desktop) 172 :group 'desktop)
173 173
174(defcustom desktop-globals-to-save '( 174(defcustom desktop-globals-to-save
175 desktop-missing-file-warning 175 '(desktop-missing-file-warning
176 tags-file-name 176 tags-file-name
177 tags-table-list 177 tags-table-list
178 search-ring 178 search-ring
179 regexp-search-ring 179 regexp-search-ring
180 register-alist) 180 register-alist)
181 "List of global variables saved by `desktop-save'. 181 "List of global variables saved by `desktop-save'.
182An element may be variable name (a symbol) or a cons cell of the form 182An element may be variable name (a symbol) or a cons cell of the form
183\(VAR . MAX-SIZE), which means to truncate VAR's value to at most 183\(VAR . MAX-SIZE), which means to truncate VAR's value to at most
@@ -186,13 +186,13 @@ Feature: Saving `kill-ring' implies saving `kill-ring-yank-pointer'."
186 :type '(repeat (restricted-sexp :match-alternatives (symbolp consp))) 186 :type '(repeat (restricted-sexp :match-alternatives (symbolp consp)))
187 :group 'desktop) 187 :group 'desktop)
188 188
189(defcustom desktop-globals-to-clear '( 189(defcustom desktop-globals-to-clear
190 kill-ring 190 '(kill-ring
191 kill-ring-yank-pointer 191 kill-ring-yank-pointer
192 search-ring 192 search-ring
193 search-ring-yank-pointer 193 search-ring-yank-pointer
194 regexp-search-ring 194 regexp-search-ring
195 regexp-search-ring-yank-pointer) 195 regexp-search-ring-yank-pointer)
196 "List of global variables to clear by `desktop-clear'. 196 "List of global variables to clear by `desktop-clear'.
197An element may be variable name (a symbol) or a cons cell of the form 197An element may be variable name (a symbol) or a cons cell of the form
198\(VAR . FORM). Symbols are set to nil and for cons cells VAR is set 198\(VAR . FORM). Symbols are set to nil and for cons cells VAR is set
@@ -202,29 +202,27 @@ to the value obtained by evaluateing FORM."
202 202
203(defcustom desktop-clear-preserve-buffers-regexp 203(defcustom desktop-clear-preserve-buffers-regexp
204 "^\\(\\*scratch\\*\\|\\*Messages\\*\\|\\*tramp/.+\\*\\)$" 204 "^\\(\\*scratch\\*\\|\\*Messages\\*\\|\\*tramp/.+\\*\\)$"
205 "Regexp identifying buffers that `desktop-clear' should not delete." 205 "Regexp identifying buffers that `desktop-clear' should not delete.
206See also `desktop-clear-preserve-buffers'."
206 :type 'regexp 207 :type 'regexp
207 :group 'desktop) 208 :group 'desktop)
208 209
209;; Maintained for backward compatibility
210(defcustom desktop-clear-preserve-buffers nil 210(defcustom desktop-clear-preserve-buffers nil
211 "*List of buffer names that `desktop-clear' should not delete. 211 "*List of buffer names that `desktop-clear' should not delete.
212This variable is maintained for backward compatibility only." 212See also `desktop-clear-preserve-buffers-regexp'."
213 :type '(repeat string) 213 :type '(repeat string)
214 :group 'desktop) 214 :group 'desktop)
215(make-obsolete-variable 'desktop-clear-preserve-buffers 215
216 'desktop-clear-preserve-buffers-regexp) 216(defcustom desktop-locals-to-save
217 217 '(desktop-locals-to-save ; Itself! Think it over.
218(defcustom desktop-locals-to-save '( 218 truncate-lines
219 desktop-locals-to-save ; Itself! Think it over. 219 case-fold-search
220 truncate-lines 220 case-replace
221 case-fold-search 221 fill-column
222 case-replace 222 overwrite-mode
223 fill-column 223 change-log-default-name
224 overwrite-mode 224 line-number-mode
225 change-log-default-name 225 buffer-file-coding-system)
226 line-number-mode
227 buffer-file-coding-system)
228 "List of local variables to save for each buffer. 226 "List of local variables to save for each buffer.
229The variables are saved only when they really are local." 227The variables are saved only when they really are local."
230 :type '(repeat symbol) 228 :type '(repeat symbol)
@@ -282,11 +280,11 @@ DESKTOP-BUFFER-MISC.")
282(make-obsolete-variable 'desktop-buffer-misc-functions 280(make-obsolete-variable 'desktop-buffer-misc-functions
283 'desktop-save-buffer) 281 'desktop-save-buffer)
284 282
285(defcustom desktop-buffer-mode-handlers '( 283(defcustom desktop-buffer-mode-handlers
286 (dired-mode . dired-restore-desktop-buffer) 284 '((dired-mode . dired-restore-desktop-buffer)
287 (rmail-mode . rmail-restore-desktop-buffer) 285 (rmail-mode . rmail-restore-desktop-buffer)
288 (mh-folder-mode . mh-restore-desktop-buffer) 286 (mh-folder-mode . mh-restore-desktop-buffer)
289 (Info-mode . Info-restore-desktop-buffer)) 287 (Info-mode . Info-restore-desktop-buffer))
290 "Alist of major mode specific functions to restore a desktop buffer. 288 "Alist of major mode specific functions to restore a desktop buffer.
291Functions are called by `desktop-read'. List elements must have the form 289Functions are called by `desktop-read'. List elements must have the form
292\(MAJOR-MODE . RESTORE-BUFFER-FUNCTION). 290\(MAJOR-MODE . RESTORE-BUFFER-FUNCTION).
@@ -580,8 +578,7 @@ See also `desktop-base-file-name'."
580 (let ((filename (expand-file-name desktop-base-file-name dirname)) 578 (let ((filename (expand-file-name desktop-base-file-name dirname))
581 (info 579 (info
582 (mapcar 580 (mapcar
583 (function 581 #'(lambda (b)
584 (lambda (b)
585 (set-buffer b) 582 (set-buffer b)
586 (list 583 (list
587 (desktop-file-name (buffer-file-name) dirname) 584 (desktop-file-name (buffer-file-name) dirname)
@@ -618,7 +615,7 @@ See also `desktop-base-file-name'."
618 (when (member (car locals) loclist) 615 (when (member (car locals) loclist)
619 (setq ll (cons (car locals) ll))))) 616 (setq ll (cons (car locals) ll)))))
620 (setq locals (cdr locals))) 617 (setq locals (cdr locals)))
621 ll)))) 618 ll)))
622 (buffer-list))) 619 (buffer-list)))
623 (buf (get-buffer-create "*desktop*"))) 620 (buf (get-buffer-create "*desktop*")))
624 (set-buffer buf) 621 (set-buffer buf)
@@ -639,19 +636,15 @@ See also `desktop-base-file-name'."
639 " kill-ring))\n")) 636 " kill-ring))\n"))
640 637
641 (insert "\n;; Buffer section -- buffers listed in same order as in buffer list:\n") 638 (insert "\n;; Buffer section -- buffers listed in same order as in buffer list:\n")
642 (mapcar 639 (mapcar #'(lambda (l)
643 (function 640 (if (apply 'desktop-save-buffer-p l)
644 (lambda (l) 641 (progn
645 (if (apply 'desktop-save-buffer-p l) 642 (insert "(desktop-create-buffer " desktop-file-version)
646 (progn 643 (mapcar #'(lambda (e)
647 (insert "(desktop-create-buffer " desktop-file-version) 644 (insert "\n " (desktop-value-to-string e)))
648 (mapcar 645 l)
649 (function 646 (insert ")\n\n"))))
650 (lambda (e) 647 info)
651 (insert "\n " (desktop-value-to-string e))))
652 l)
653 (insert ")\n\n")))))
654 info)
655 (setq default-directory dirname) 648 (setq default-directory dirname)
656 (when (file-exists-p filename) (delete-file filename)) 649 (when (file-exists-p filename) (delete-file filename))
657 (let ((coding-system-for-write 'emacs-mule)) 650 (let ((coding-system-for-write 'emacs-mule))
@@ -816,18 +809,18 @@ directory DIRNAME."
816 (defvar desktop-first-buffer) ;; Dynamically bound in `desktop-read' 809 (defvar desktop-first-buffer) ;; Dynamically bound in `desktop-read'
817) 810)
818 811
819(defun desktop-create-buffer ( 812(defun desktop-create-buffer
820 desktop-file-version 813 (desktop-file-version
821 desktop-buffer-file-name 814 desktop-buffer-file-name
822 desktop-buffer-name 815 desktop-buffer-name
823 desktop-buffer-major-mode 816 desktop-buffer-major-mode
824 desktop-buffer-minor-modes 817 desktop-buffer-minor-modes
825 desktop-buffer-point 818 desktop-buffer-point
826 desktop-buffer-mark 819 desktop-buffer-mark
827 desktop-buffer-read-only 820 desktop-buffer-read-only
828 desktop-buffer-misc 821 desktop-buffer-misc
829 &optional 822 &optional
830 desktop-buffer-locals) 823 desktop-buffer-locals)
831 ;; Just to silence the byte compiler. Bound locally in `desktop-read'. 824 ;; Just to silence the byte compiler. Bound locally in `desktop-read'.
832 (eval-when-compile 825 (eval-when-compile
833 (defvar desktop-buffer-ok-count) 826 (defvar desktop-buffer-ok-count)
@@ -835,21 +828,21 @@ directory DIRNAME."
835 ;; To make desktop files with relative file names possible, we cannot 828 ;; To make desktop files with relative file names possible, we cannot
836 ;; allow `default-directory' to change. Therefore we save current buffer. 829 ;; allow `default-directory' to change. Therefore we save current buffer.
837 (save-current-buffer 830 (save-current-buffer
838 (let ( 831 (let ((buffer-list (buffer-list))
839 (buffer-list (buffer-list)) 832 (result
840 (result 833 (condition-case err
841 (condition-case err 834 (funcall (or (cdr (assq desktop-buffer-major-mode
842 (funcall (or (cdr (assq desktop-buffer-major-mode desktop-buffer-mode-handlers)) 835 desktop-buffer-mode-handlers))
843 'desktop-restore-file-buffer) 836 'desktop-restore-file-buffer)
844 desktop-buffer-file-name 837 desktop-buffer-file-name
845 desktop-buffer-name 838 desktop-buffer-name
846 desktop-buffer-misc) 839 desktop-buffer-misc)
847 (error 840 (error
848 (message "Desktop: Can't load buffer %s: %s" 841 (message "Desktop: Can't load buffer %s: %s"
849 desktop-buffer-name (error-message-string err)) 842 desktop-buffer-name
850 (when desktop-missing-file-warning (sit-for 1)) 843 (error-message-string err))
851 nil))) 844 (when desktop-missing-file-warning (sit-for 1))
852 ) 845 nil))))
853 (if (bufferp result) 846 (if (bufferp result)
854 (setq desktop-buffer-ok-count (1+ desktop-buffer-ok-count)) 847 (setq desktop-buffer-ok-count (1+ desktop-buffer-ok-count))
855 (setq desktop-buffer-fail-count (1+ desktop-buffer-fail-count)) 848 (setq desktop-buffer-fail-count (1+ desktop-buffer-fail-count))
@@ -867,17 +860,14 @@ directory DIRNAME."
867 (unless (equal (buffer-name) desktop-buffer-name) 860 (unless (equal (buffer-name) desktop-buffer-name)
868 (rename-buffer desktop-buffer-name)) 861 (rename-buffer desktop-buffer-name))
869 ;; minor modes 862 ;; minor modes
870 (cond ( 863 (cond ((equal '(t) desktop-buffer-minor-modes) ; backwards compatible
871 ;; backwards compatible 864 (auto-fill-mode 1))
872 (equal '(t) desktop-buffer-minor-modes) 865 ((equal '(nil) desktop-buffer-minor-modes) ; backwards compatible
873 (auto-fill-mode 1))( 866 (auto-fill-mode 0))
874 (equal '(nil) desktop-buffer-minor-modes) 867 (t
875 (auto-fill-mode 0))( 868 (mapcar #'(lambda (minor-mode)
876 t 869 (when (functionp minor-mode) (funcall minor-mode 1)))
877 (mapcar 870 desktop-buffer-minor-modes)))
878 #'(lambda (minor-mode)
879 (when (functionp minor-mode) (funcall minor-mode 1)))
880 desktop-buffer-minor-modes)))
881 ;; Even though point and mark are non-nil when written by `desktop-save' 871 ;; Even though point and mark are non-nil when written by `desktop-save'
882 ;; they may be modified by handlers wanting to set point or mark themselves. 872 ;; they may be modified by handlers wanting to set point or mark themselves.
883 (when desktop-buffer-point 873 (when desktop-buffer-point