Function: desktop-outvar

desktop-outvar is a byte-compiled function defined in desktop.el.gz.

Signature

(desktop-outvar VARSPEC)

Documentation

Output a setq statement for variable VAR to the desktop file.

The argument VARSPEC may be the variable name VAR (a symbol), or a cons cell of the form (VAR . MAX-SIZE), which means to truncate VAR's value to at most MAX-SIZE elements
(if the value is a list) before saving the value.

Source Code

;; Defined in /usr/src/emacs/lisp/desktop.el.gz
;; ----------------------------------------------------------------------------
(defun desktop-outvar (varspec)
  "Output a setq statement for variable VAR to the desktop file.
The argument VARSPEC may be the variable name VAR (a symbol),
or a cons cell of the form (VAR . MAX-SIZE),
which means to truncate VAR's value to at most MAX-SIZE elements
\(if the value is a list) before saving the value."
  (let (var size)
    (if (consp varspec)
	(setq var (car varspec) size (cdr varspec))
      (setq var varspec))
    (when (boundp var)
      (when (and (integerp size)
		 (> size 0)
		 (listp (symbol-value var)))
	(desktop-truncate (symbol-value var) size))
      (insert "(setq "
	      (symbol-name var)
	      " "
	      (desktop-value-to-string (symbol-value var))
	      ")\n"))))