From e8f38d1364a8879c91cb810160a5d2d5f7437bde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincent=20Bela=C3=AFche?= Date: Sat, 27 Jul 2024 18:33:00 +0200 Subject: [PATCH] Make sure SES always writes non abbreviated expressions to data area. Corrupted data area would occur when print-length or print-level are non nil. --- lisp/ses.el | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lisp/ses.el b/lisp/ses.el index c9bd0ab18da..8b270842734 100644 --- a/lisp/ses.el +++ b/lisp/ses.el @@ -1443,9 +1443,10 @@ undoable. Return nil when there was no change, and non-nil otherwise." (ses-widen) (goto-char ses--params-marker) (forward-line (plist-get ses-paramlines-plist 'ses--numlocprn )) - (insert (format (plist-get ses-paramfmt-plist 'ses--numlocprn) - ses--numlocprn) - ?\n) + (let (print-level print-length) + (insert (format (plist-get ses-paramfmt-plist 'ses--numlocprn) + ses--numlocprn) + ?\n)) t) ))) (defun ses-set-parameter (def value &optional elem) @@ -1467,7 +1468,7 @@ If ELEM is specified, it is the array subscript within DEF to be set to VALUE." (setq oldval (symbol-value def)) (set def value)) ;; Special undo since it's outside the narrowed buffer. - (let (buffer-undo-list) + (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)))) @@ -1478,6 +1479,7 @@ If ELEM is specified, it is the array subscript within DEF to be set to VALUE." Newlines in the data are escaped." (let* ((inhibit-read-only t) (print-escape-newlines t) + print-level print-length rowcol row col cell sym formula printer text) (setq ses-start-time (float-time)) (with-temp-message " " @@ -2532,7 +2534,7 @@ Return nil if cell formula was unsafe and user declined confirmation." (row (car rowcol)) (col (cdr rowcol)) (formula (ses-cell-formula row col)) - initial) + initial print-level print-length) (if (eq (car-safe formula) 'ses-safe-formula) (setq formula (cadr formula))) (if (eq (car-safe formula) 'quote)