]> git.eshelyaron.com Git - emacs.git/commitdiff
Make sure SES always writes non abbreviated expressions to data area.
authorVincent Belaïche <vincentb1@users.sourceforge.net>
Sat, 27 Jul 2024 16:33:00 +0000 (18:33 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sat, 27 Jul 2024 20:06:09 +0000 (22:06 +0200)
Corrupted data area would occur when print-length or print-level are non nil.

(cherry picked from commit e8f38d1364a8879c91cb810160a5d2d5f7437bde)

lisp/ses.el

index c9bd0ab18da3273043385bca3f4f36dcfdc11a78..8b2708427348ae06b280eef0d89a8db2ccf7388e 100644 (file)
@@ -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)