diff options
| author | Vincent Belaïche | 2017-03-20 22:42:00 +0100 |
|---|---|---|
| committer | Vincent Belaïche | 2017-03-20 22:42:00 +0100 |
| commit | 205223f4725864e1fb53df5cd12694d0bc89f7d0 (patch) | |
| tree | f99bdb513f594b16a4e6b1e2145d7d8a6ede54ea /lisp | |
| parent | 3c4ec7e1d2fd0197c5fcadac7dd35414b7be72cb (diff) | |
| download | emacs-205223f4725864e1fb53df5cd12694d0bc89f7d0.tar.gz emacs-205223f4725864e1fb53df5cd12694d0bc89f7d0.zip | |
Solve ses-recalculate-cell updating only current line bug.
* lisp/ses.el (ses-recalculate-cell): Add optional argument
ses--curcell to avoid overwriting ses--curcell when function is
called from ses-recalculate-all. Update docstring accordingly.
(ses-recalculate-all): Call ses-recalculate-cell with argument
ses--curcell to avoid its overwriting.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ses.el | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lisp/ses.el b/lisp/ses.el index 76d4ca577d7..50507132346 100644 --- a/lisp/ses.el +++ b/lisp/ses.el | |||
| @@ -1,4 +1,3 @@ | |||
| 1 | |||
| 2 | ;;; ses.el -- Simple Emacs Spreadsheet -*- lexical-binding:t -*- | 1 | ;;; ses.el -- Simple Emacs Spreadsheet -*- lexical-binding:t -*- |
| 3 | 2 | ||
| 4 | ;; Copyright (C) 2002-2017 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 2002-2017 Free Software Foundation, Inc. |
| @@ -2273,15 +2272,19 @@ print area if NONARROW is nil." | |||
| 2273 | ;; (defvar maxrow) | 2272 | ;; (defvar maxrow) |
| 2274 | ;; (defvar maxcol) | 2273 | ;; (defvar maxcol) |
| 2275 | 2274 | ||
| 2276 | (defun ses-recalculate-cell () | 2275 | (defun ses-recalculate-cell (&optional ses--curcell) |
| 2277 | "Recalculate and reprint the current cell or range. | 2276 | "Recalculate and reprint the current cell or range. |
| 2278 | 2277 | ||
| 2278 | If SES--CURCELL is non nil use it as current cell or range | ||
| 2279 | without any check, otherwise fnuction (ses-check-curcell 'range) | ||
| 2280 | is called. | ||
| 2281 | |||
| 2279 | For an individual cell, shows the error if the formula or printer | 2282 | For an individual cell, shows the error if the formula or printer |
| 2280 | signals one, or otherwise shows the cell's complete value. For a range, the | 2283 | signals one, or otherwise shows the cell's complete value. For a range, the |
| 2281 | cells are recalculated in \"natural\" order, so cells that other cells refer | 2284 | cells are recalculated in \"natural\" order, so cells that other cells refer |
| 2282 | to are recalculated first." | 2285 | to are recalculated first." |
| 2283 | (interactive "*") | 2286 | (interactive "*") |
| 2284 | (ses-check-curcell 'range) | 2287 | (or ses--curcell (ses-check-curcell 'range)) |
| 2285 | (ses-begin-change) | 2288 | (ses-begin-change) |
| 2286 | (ses-initialize-Dijkstra-attempt) | 2289 | (ses-initialize-Dijkstra-attempt) |
| 2287 | (let (sig cur-rowcol) | 2290 | (let (sig cur-rowcol) |
| @@ -2334,7 +2337,7 @@ to are recalculated first." | |||
| 2334 | (let ((startcell (ses--cell-at-pos (point))) | 2337 | (let ((startcell (ses--cell-at-pos (point))) |
| 2335 | (ses--curcell (cons 'A1 (ses-cell-symbol (1- ses--numrows) | 2338 | (ses--curcell (cons 'A1 (ses-cell-symbol (1- ses--numrows) |
| 2336 | (1- ses--numcols))))) | 2339 | (1- ses--numcols))))) |
| 2337 | (ses-recalculate-cell) | 2340 | (ses-recalculate-cell ses--curcell) |
| 2338 | (ses-jump-safe startcell))) | 2341 | (ses-jump-safe startcell))) |
| 2339 | 2342 | ||
| 2340 | (defun ses-truncate-cell () | 2343 | (defun ses-truncate-cell () |