Function: ses-set-parameter
ses-set-parameter is a byte-compiled function defined in ses.el.gz.
Signature
(ses-set-parameter DEF VALUE &optional ELEM)
Documentation
Set parameter DEF to VALUE (with undo) and write the value to the data area.
See ses-goto-data for meaning of DEF. Newlines in the data are escaped.
If ELEM is specified, it is the array subscript within DEF to be set to VALUE.
Source Code
;; Defined in /usr/src/emacs/lisp/ses.el.gz
(defun ses-set-parameter (def value &optional elem)
"Set parameter DEF to VALUE (with undo) and write the value to the data area.
See `ses-goto-data' for meaning of DEF. Newlines in the data are escaped.
If ELEM is specified, it is the array subscript within DEF to be set to VALUE."
(save-excursion
;; We call ses-goto-data early, using the old values of numrows and numcols
;; in case one of them is being changed.
(ses-goto-data def)
(let ((inhibit-read-only t)
(fmt (plist-get ses-paramfmt-plist
def))
oldval)
(if elem
(progn
(setq oldval (aref (symbol-value def) elem))
(aset (symbol-value def) elem value))
(setq oldval (symbol-value def))
(set def value))
;; Special undo since it's outside the narrowed buffer.
(let (buffer-undo-list print-level print-length)
(delete-region (point) (line-end-position))
(insert (format fmt (symbol-value def))))
(push `(apply ses-set-parameter ,def ,oldval ,elem) buffer-undo-list))))