emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/desktop.el [emacs-unicode-2]


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/lisp/desktop.el [emacs-unicode-2]
Date: Wed, 15 Sep 2004 05:23:20 -0400

Index: emacs/lisp/desktop.el
diff -c emacs/lisp/desktop.el:1.60.2.3 emacs/lisp/desktop.el:1.60.2.4
*** emacs/lisp/desktop.el:1.60.2.3      Mon Jun 28 07:28:28 2004
--- emacs/lisp/desktop.el       Wed Sep 15 08:59:55 2004
***************
*** 171,183 ****
    :type 'hook
    :group 'desktop)
  
! (defcustom desktop-globals-to-save '(
!   desktop-missing-file-warning
!   tags-file-name
!   tags-table-list
!   search-ring
!   regexp-search-ring
!   register-alist)
    "List of global variables saved by `desktop-save'.
  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
--- 171,183 ----
    :type 'hook
    :group 'desktop)
  
! (defcustom desktop-globals-to-save
!   '(desktop-missing-file-warning
!     tags-file-name
!     tags-table-list
!     search-ring
!     regexp-search-ring
!     register-alist)
    "List of global variables saved by `desktop-save'.
  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
***************
*** 186,198 ****
    :type '(repeat (restricted-sexp :match-alternatives (symbolp consp)))
    :group 'desktop)
  
! (defcustom desktop-globals-to-clear '(
!   kill-ring
!   kill-ring-yank-pointer
!   search-ring
!   search-ring-yank-pointer
!   regexp-search-ring
!   regexp-search-ring-yank-pointer)
    "List of global variables to clear by `desktop-clear'.
  An element may be variable name (a symbol) or a cons cell of the form
  \(VAR . FORM). Symbols are set to nil and for cons cells VAR is set
--- 186,198 ----
    :type '(repeat (restricted-sexp :match-alternatives (symbolp consp)))
    :group 'desktop)
  
! (defcustom desktop-globals-to-clear
!   '(kill-ring
!     kill-ring-yank-pointer
!     search-ring
!     search-ring-yank-pointer
!     regexp-search-ring
!     regexp-search-ring-yank-pointer)
    "List of global variables to clear by `desktop-clear'.
  An element may be variable name (a symbol) or a cons cell of the form
  \(VAR . FORM). Symbols are set to nil and for cons cells VAR is set
***************
*** 202,230 ****
  
  (defcustom desktop-clear-preserve-buffers-regexp
    "^\\(\\*scratch\\*\\|\\*Messages\\*\\|\\*tramp/.+\\*\\)$"
!   "Regexp identifying buffers that `desktop-clear' should not delete."
    :type 'regexp
    :group 'desktop)
  
- ;; Maintained for backward compatibility
  (defcustom desktop-clear-preserve-buffers nil
    "*List of buffer names that `desktop-clear' should not delete.
! This variable is maintained for backward compatibility only."
    :type '(repeat string)
    :group 'desktop)
- (make-obsolete-variable 'desktop-clear-preserve-buffers
-                         'desktop-clear-preserve-buffers-regexp)
  
! (defcustom desktop-locals-to-save '(
!   desktop-locals-to-save  ; Itself!  Think it over.
!   truncate-lines
!   case-fold-search
!   case-replace
!   fill-column
!   overwrite-mode
!   change-log-default-name
!   line-number-mode
!   buffer-file-coding-system)
    "List of local variables to save for each buffer.
  The variables are saved only when they really are local."
    :type '(repeat symbol)
--- 202,228 ----
  
  (defcustom desktop-clear-preserve-buffers-regexp
    "^\\(\\*scratch\\*\\|\\*Messages\\*\\|\\*tramp/.+\\*\\)$"
!   "Regexp identifying buffers that `desktop-clear' should not delete.
! See also `desktop-clear-preserve-buffers'."
    :type 'regexp
    :group 'desktop)
  
  (defcustom desktop-clear-preserve-buffers nil
    "*List of buffer names that `desktop-clear' should not delete.
! See also `desktop-clear-preserve-buffers-regexp'."
    :type '(repeat string)
    :group 'desktop)
  
! (defcustom desktop-locals-to-save
!   '(desktop-locals-to-save  ; Itself!  Think it over.
!     truncate-lines
!     case-fold-search
!     case-replace
!     fill-column
!     overwrite-mode
!     change-log-default-name
!     line-number-mode
!     buffer-file-coding-system)
    "List of local variables to save for each buffer.
  The variables are saved only when they really are local."
    :type '(repeat symbol)
***************
*** 282,292 ****
  (make-obsolete-variable 'desktop-buffer-misc-functions
                          'desktop-save-buffer)
  
! (defcustom desktop-buffer-mode-handlers '(
!   (dired-mode . dired-restore-desktop-buffer)
!   (rmail-mode . rmail-restore-desktop-buffer)
!   (mh-folder-mode . mh-restore-desktop-buffer)
!   (Info-mode . Info-restore-desktop-buffer))
    "Alist of major mode specific functions to restore a desktop buffer.
  Functions are called by `desktop-read'. List elements must have the form
  \(MAJOR-MODE . RESTORE-BUFFER-FUNCTION).
--- 280,290 ----
  (make-obsolete-variable 'desktop-buffer-misc-functions
                          'desktop-save-buffer)
  
! (defcustom desktop-buffer-mode-handlers
!   '((dired-mode . dired-restore-desktop-buffer)
!     (rmail-mode . rmail-restore-desktop-buffer)
!     (mh-folder-mode . mh-restore-desktop-buffer)
!     (Info-mode . Info-restore-desktop-buffer))
    "Alist of major mode specific functions to restore a desktop buffer.
  Functions are called by `desktop-read'. List elements must have the form
  \(MAJOR-MODE . RESTORE-BUFFER-FUNCTION).
***************
*** 580,587 ****
      (let ((filename (expand-file-name desktop-base-file-name dirname))
            (info
              (mapcar
!               (function
!                 (lambda (b)
                    (set-buffer b)
                    (list
                      (desktop-file-name (buffer-file-name) dirname)
--- 578,584 ----
      (let ((filename (expand-file-name desktop-base-file-name dirname))
            (info
              (mapcar
!               #'(lambda (b)
                    (set-buffer b)
                    (list
                      (desktop-file-name (buffer-file-name) dirname)
***************
*** 618,624 ****
                              (when (member (car locals) loclist)
                                (setq ll (cons (car locals) ll)))))
                          (setq locals (cdr locals)))
!                       ll))))
                (buffer-list)))
            (buf (get-buffer-create "*desktop*")))
        (set-buffer buf)
--- 615,621 ----
                              (when (member (car locals) loclist)
                                (setq ll (cons (car locals) ll)))))
                          (setq locals (cdr locals)))
!                       ll)))
                (buffer-list)))
            (buf (get-buffer-create "*desktop*")))
        (set-buffer buf)
***************
*** 639,657 ****
            " kill-ring))\n"))
  
        (insert "\n;; Buffer section -- buffers listed in same order as in 
buffer list:\n")
!       (mapcar
!         (function
!           (lambda (l)
!             (if (apply 'desktop-save-buffer-p l)
!               (progn
!                 (insert "(desktop-create-buffer " desktop-file-version)
!                 (mapcar
!                   (function
!                     (lambda (e)
!                       (insert "\n  " (desktop-value-to-string e))))
!                   l)
!                 (insert ")\n\n")))))
!         info)
        (setq default-directory dirname)
        (when (file-exists-p filename) (delete-file filename))
        (let ((coding-system-for-write 'utf-8-emacs))
--- 636,650 ----
            " kill-ring))\n"))
  
        (insert "\n;; Buffer section -- buffers listed in same order as in 
buffer list:\n")
!       (mapcar #'(lambda (l)
!                   (if (apply 'desktop-save-buffer-p l)
!                       (progn
!                         (insert "(desktop-create-buffer " 
desktop-file-version)
!                         (mapcar #'(lambda (e)
!                                     (insert "\n  " (desktop-value-to-string 
e)))
!                                 l)
!                         (insert ")\n\n"))))
!               info)
        (setq default-directory dirname)
        (when (file-exists-p filename) (delete-file filename))
        (let ((coding-system-for-write 'utf-8-emacs))
***************
*** 816,833 ****
     (defvar desktop-first-buffer) ;; Dynamically bound in `desktop-read'
  )
  
! (defun desktop-create-buffer (
!   desktop-file-version
!   desktop-buffer-file-name
!   desktop-buffer-name
!   desktop-buffer-major-mode
!   desktop-buffer-minor-modes
!   desktop-buffer-point
!   desktop-buffer-mark
!   desktop-buffer-read-only
!   desktop-buffer-misc
!   &optional
!   desktop-buffer-locals)
    ;; Just to silence the byte compiler. Bound locally in `desktop-read'.
    (eval-when-compile
      (defvar desktop-buffer-ok-count)
--- 809,826 ----
     (defvar desktop-first-buffer) ;; Dynamically bound in `desktop-read'
  )
  
! (defun desktop-create-buffer
!   (desktop-file-version
!    desktop-buffer-file-name
!    desktop-buffer-name
!    desktop-buffer-major-mode
!    desktop-buffer-minor-modes
!    desktop-buffer-point
!    desktop-buffer-mark
!    desktop-buffer-read-only
!    desktop-buffer-misc
!    &optional
!    desktop-buffer-locals)
    ;; Just to silence the byte compiler. Bound locally in `desktop-read'.
    (eval-when-compile
      (defvar desktop-buffer-ok-count)
***************
*** 835,855 ****
    ;; To make desktop files with relative file names possible, we cannot
    ;; allow `default-directory' to change. Therefore we save current buffer.
    (save-current-buffer
!     (let (
!       (buffer-list (buffer-list))
!       (result
!          (condition-case err
!              (funcall (or (cdr (assq desktop-buffer-major-mode 
desktop-buffer-mode-handlers))
!                           'desktop-restore-file-buffer)
!                       desktop-buffer-file-name
!                       desktop-buffer-name
!                       desktop-buffer-misc)
!            (error
!              (message "Desktop: Can't load buffer %s: %s"
!                       desktop-buffer-name (error-message-string err))
!              (when desktop-missing-file-warning (sit-for 1))
!              nil)))
!     )
        (if (bufferp result)
            (setq desktop-buffer-ok-count (1+ desktop-buffer-ok-count))
          (setq desktop-buffer-fail-count (1+ desktop-buffer-fail-count))
--- 828,848 ----
    ;; To make desktop files with relative file names possible, we cannot
    ;; allow `default-directory' to change. Therefore we save current buffer.
    (save-current-buffer
!     (let ((buffer-list (buffer-list))
!           (result
!            (condition-case err
!                (funcall (or (cdr (assq desktop-buffer-major-mode
!                                        desktop-buffer-mode-handlers))
!                             'desktop-restore-file-buffer)
!                         desktop-buffer-file-name
!                         desktop-buffer-name
!                         desktop-buffer-misc)
!              (error
!               (message "Desktop: Can't load buffer %s: %s"
!                        desktop-buffer-name
!                        (error-message-string err))
!               (when desktop-missing-file-warning (sit-for 1))
!               nil))))
        (if (bufferp result)
            (setq desktop-buffer-ok-count (1+ desktop-buffer-ok-count))
          (setq desktop-buffer-fail-count (1+ desktop-buffer-fail-count))
***************
*** 867,883 ****
          (unless (equal (buffer-name) desktop-buffer-name)
            (rename-buffer desktop-buffer-name))
          ;; minor modes
!         (cond (
!           ;; backwards compatible
!           (equal '(t) desktop-buffer-minor-modes)
!           (auto-fill-mode 1))(
!           (equal '(nil) desktop-buffer-minor-modes)
!           (auto-fill-mode 0))(
!           t
!           (mapcar
!             #'(lambda (minor-mode)
!               (when (functionp minor-mode) (funcall minor-mode 1)))
!             desktop-buffer-minor-modes)))
          ;; Even though point and mark are non-nil when written by 
`desktop-save'
          ;; they may be modified by handlers wanting to set point or mark 
themselves.
          (when desktop-buffer-point
--- 860,873 ----
          (unless (equal (buffer-name) desktop-buffer-name)
            (rename-buffer desktop-buffer-name))
          ;; minor modes
!         (cond ((equal '(t) desktop-buffer-minor-modes) ; backwards compatible
!                (auto-fill-mode 1))
!               ((equal '(nil) desktop-buffer-minor-modes) ; backwards 
compatible
!                (auto-fill-mode 0))
!               (t
!                (mapcar #'(lambda (minor-mode)
!                            (when (functionp minor-mode) (funcall minor-mode 
1)))
!                        desktop-buffer-minor-modes)))
          ;; Even though point and mark are non-nil when written by 
`desktop-save'
          ;; they may be modified by handlers wanting to set point or mark 
themselves.
          (when desktop-buffer-point




reply via email to

[Prev in Thread] Current Thread [Next in Thread]