diff options
| author | Vincent Belaïche | 2015-12-31 00:10:37 +0100 |
|---|---|---|
| committer | Vincent Belaïche | 2015-12-31 00:10:37 +0100 |
| commit | 0c9abf36a4fbc775918c08c1104a64d037280abc (patch) | |
| tree | 62cd80cddb9af69b3bd606874d272e47eb6d09ec | |
| parent | 209e30bac2d73c2e6f1c46b0d7281b474527cfa4 (diff) | |
| download | emacs-0c9abf36a4fbc775918c08c1104a64d037280abc.tar.gz emacs-0c9abf36a4fbc775918c08c1104a64d037280abc.zip | |
Correct ses-rename-cell cursor-intangible text prop updating.
There were two problems:
- First ses-rename-cell has to work when called non interactively
(with non-nil CELL argument), so in this case the start pos of
put-text-property cannot be plainly (point), you need a
ses-goto-print call before
- Second, the range itself was computed erronously, only the first
char was affected instead of the full cell width. This was not
noticeable prior to changes (Deprecate `intangible' and
`point-entered' properties) made by Stefan on 2015-04-13T19:51:15Z
* lisp/ses.el (ses-rename-cell): Correct computation of position range
to which the 'cursor-intangible text property has to be set to cell
new name.
| -rw-r--r-- | lisp/ses.el | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/lisp/ses.el b/lisp/ses.el index 8cbc2e80cde..3e35fc10ac6 100644 --- a/lisp/ses.el +++ b/lisp/ses.el | |||
| @@ -3414,15 +3414,17 @@ highlighted range in the spreadsheet." | |||
| 3414 | (setf (ses-cell--symbol cell) new-name) | 3414 | (setf (ses-cell--symbol cell) new-name) |
| 3415 | (makunbound sym) | 3415 | (makunbound sym) |
| 3416 | (and curcell (setq ses--curcell new-name)) | 3416 | (and curcell (setq ses--curcell new-name)) |
| 3417 | (let* ((pos (point)) | 3417 | (save-excursion |
| 3418 | (inhibit-read-only t) | 3418 | (or curcell (ses-goto-print row col)) |
| 3419 | (col (current-column)) | 3419 | (let* ((pos (point)) |
| 3420 | (end (save-excursion | 3420 | (inhibit-read-only t) |
| 3421 | (move-to-column (1+ col)) | 3421 | (end (progn |
| 3422 | (if (eolp) | 3422 | (move-to-column (+ (current-column) (ses-col-width col))) |
| 3423 | (+ pos (ses-col-width col) 1) | 3423 | (if (eolp) |
| 3424 | (point))))) | 3424 | (+ pos (ses-col-width col) 1) |
| 3425 | (put-text-property pos end 'cursor-intangible new-name)) | 3425 | (forward-char) |
| 3426 | (point))))) | ||
| 3427 | (put-text-property pos end 'cursor-intangible new-name))) | ||
| 3426 | ;; Update the cell name in the mode-line. | 3428 | ;; Update the cell name in the mode-line. |
| 3427 | (force-mode-line-update))) | 3429 | (force-mode-line-update))) |
| 3428 | 3430 | ||