]> code.delx.au - gnu-emacs/blobdiff - lisp/ses.el
Merge branch 'emacs-25-merge'
[gnu-emacs] / lisp / ses.el
index d15483f4783baa22c15fbaa14706e27707dd6e36..86b0ae672acc539b079519612d07da7f5c6af42d 100644 (file)
@@ -1117,9 +1117,7 @@ region, or nil if cursor is not at a cell."
 The end marker is appropriate if some argument is `end'.
 A range is appropriate if some argument is `range'.
 A single cell is appropriate unless some argument is `needrange'."
-  (if (eq ses--curcell t)
-      ;; curcell recalculation was postponed, but user typed ahead.
-      (ses-set-curcell))
+  (ses-set-curcell); fix  bug#21054
   (cond
    ((not ses--curcell)
     (or (memq 'end args)
@@ -1285,7 +1283,7 @@ printer signaled one (and \"%s\" is used as the default printer), else nil."
                           (and locprn
                                (ses--locprn-compiled locprn))))
                    printer)
-               (or value "")))
+               value))
        (if (stringp value)
            value
          (or (stringp (car-safe value))
@@ -3410,15 +3408,17 @@ highlighted range in the spreadsheet."
     (setf (ses-cell--symbol cell) new-name)
     (makunbound sym)
     (and curcell (setq ses--curcell new-name))
-    (let* ((pos (point))
-          (inhibit-read-only t)
-          (col (current-column))
-          (end (save-excursion
-                 (move-to-column (1+ col))
-                 (if (eolp)
-                     (+ pos (ses-col-width col) 1)
-                   (point)))))
-      (put-text-property pos end 'cursor-intangible new-name))
+    (save-excursion
+      (or curcell (ses-goto-print row col))
+      (let* ((pos (point))
+             (inhibit-read-only t)
+             (end (progn
+                    (move-to-column (+ (current-column) (ses-col-width col)))
+                    (if (eolp)
+                        (+ pos (ses-col-width col) 1)
+                      (forward-char)
+                      (point)))))
+        (put-text-property pos end 'cursor-intangible new-name)))
     ;; Update the cell name in the mode-line.
     (force-mode-line-update)))