comparison lisp/desktop.el @ 68775:01a75c5115e7

(desktop-outvar): Fix typo. (desktop-save-buffer-p): Doc fix.
author Juanma Barranquero <lekktu@gmail.com>
date Fri, 10 Feb 2006 11:05:30 +0000
parents 3bd95f4f2941
children 75ac416582c4 4b3d39451150
comparison
equal deleted inserted replaced
68774:71001254327d 68775:01a75c5115e7
55 ;; ----------------- 55 ;; -----------------
56 ;; Variables `desktop-buffer-mode-handlers' and `desktop-minor-mode-handlers' 56 ;; Variables `desktop-buffer-mode-handlers' and `desktop-minor-mode-handlers'
57 ;; are supplied to handle special major and minor modes respectively. 57 ;; are supplied to handle special major and minor modes respectively.
58 ;; `desktop-buffer-mode-handlers' is an alist of major mode specific functions 58 ;; `desktop-buffer-mode-handlers' is an alist of major mode specific functions
59 ;; to restore a desktop buffer. Elements must have the form 59 ;; to restore a desktop buffer. Elements must have the form
60 ;; 60 ;;
61 ;; (MAJOR-MODE . RESTORE-BUFFER-FUNCTION). 61 ;; (MAJOR-MODE . RESTORE-BUFFER-FUNCTION).
62 ;; 62 ;;
63 ;; Functions listed are called by `desktop-create-buffer' when `desktop-read' 63 ;; Functions listed are called by `desktop-create-buffer' when `desktop-read'
64 ;; evaluates the desktop file. Buffers with a major mode not specified here, 64 ;; evaluates the desktop file. Buffers with a major mode not specified here,
65 ;; are restored by the default handler `desktop-restore-file-buffer'. 65 ;; are restored by the default handler `desktop-restore-file-buffer'.
66 ;; `desktop-minor-mode-handlers' is an alist of functions to restore 66 ;; `desktop-minor-mode-handlers' is an alist of functions to restore
67 ;; non-standard minor modes. Elements must have the form 67 ;; non-standard minor modes. Elements must have the form
68 ;; 68 ;;
69 ;; (MINOR-MODE . RESTORE-FUNCTION). 69 ;; (MINOR-MODE . RESTORE-FUNCTION).
70 ;; 70 ;;
71 ;; Functions are called by `desktop-create-buffer' to restore minor modes. 71 ;; Functions are called by `desktop-create-buffer' to restore minor modes.
72 ;; Minor modes not specified here, are restored by the standard minor mode 72 ;; Minor modes not specified here, are restored by the standard minor mode
73 ;; function. If you write a module that defines a major or minor mode that 73 ;; function. If you write a module that defines a major or minor mode that
74 ;; needs a special handler, then place code like 74 ;; needs a special handler, then place code like
75 75
659 659
660 ;; ---------------------------------------------------------------------------- 660 ;; ----------------------------------------------------------------------------
661 (defun desktop-outvar (varspec) 661 (defun desktop-outvar (varspec)
662 "Output a setq statement for variable VAR to the desktop file. 662 "Output a setq statement for variable VAR to the desktop file.
663 The argument VARSPEC may be the variable name VAR (a symbol), 663 The argument VARSPEC may be the variable name VAR (a symbol),
664 or a cons cell of the form (VAR . MAX-SIZE), 664 or a cons cell of the form (VAR . MAX-SIZE),
665 which means to truncate VAR's value to at most MAX-SIZE elements 665 which means to truncate VAR's value to at most MAX-SIZE elements
666 \(if the value is a list) before saving the value." 666 \(if the value is a list) before saving the value."
667 (let (var size) 667 (let (var size)
668 (if (consp varspec) 668 (if (consp varspec)
669 (setq var (car varspec) size (cdr varspec)) 669 (setq var (car varspec) size (cdr varspec))
682 682
683 ;; ---------------------------------------------------------------------------- 683 ;; ----------------------------------------------------------------------------
684 (defun desktop-save-buffer-p (filename bufname mode &rest dummy) 684 (defun desktop-save-buffer-p (filename bufname mode &rest dummy)
685 "Return t if buffer should have its state saved in the desktop file. 685 "Return t if buffer should have its state saved in the desktop file.
686 FILENAME is the visited file name, BUFNAME is the buffer name, and 686 FILENAME is the visited file name, BUFNAME is the buffer name, and
687 MODE is the major mode." 687 MODE is the major mode.
688 \n\(fn FILENAME BUFNAME MODE)"
688 (let ((case-fold-search nil)) 689 (let ((case-fold-search nil))
689 (and (not (string-match desktop-buffers-not-to-save bufname)) 690 (and (not (string-match desktop-buffers-not-to-save bufname))
690 (not (memq mode desktop-modes-not-to-save)) 691 (not (memq mode desktop-modes-not-to-save))
691 (or (and filename 692 (or (and filename
692 (not (string-match desktop-files-not-to-save filename))) 693 (not (string-match desktop-files-not-to-save filename)))