Function: ses-relocate-symbol

ses-relocate-symbol is a byte-compiled function defined in ses.el.gz.

Signature

(ses-relocate-symbol SYM ROWCOL STARTROW STARTCOL ROWINCR COLINCR)

Documentation

Relocate one symbol SYM, which corresponds to ROWCOL (a cons of ROW and COL). Cells starting at (STARTROW,STARTCOL) are being shifted by (ROWINCR,COLINCR).

Source Code

;; Defined in /usr/src/emacs/lisp/ses.el.gz
(defsubst ses-relocate-symbol (sym rowcol startrow startcol rowincr colincr)
  "Relocate one symbol SYM, which corresponds to ROWCOL (a cons of ROW and
COL).  Cells starting at (STARTROW,STARTCOL) are being shifted
by (ROWINCR,COLINCR)."
  (let ((row (car rowcol))
	(col (cdr rowcol)))
    (if (or (< row startrow) (< col startcol))
	sym
      (setq row (+ row rowincr)
	    col (+ col colincr))
      (if (and (>= row startrow) (>= col startcol)
	       (< row ses--numrows) (< col ses--numcols))
	  ;;Relocate this variable, unless it is a named cell
          (if (eq (get sym 'ses-cell) :ses-named)
              sym
            ;; otherwise, we create the relocated cell symbol because
            ;; ses-cell-symbol gives the old symbols, however since
            ;; renamed cell are not relocated we keep the relocated
            ;; cell old symbol in this case.
            (if (eq  (get (setq sym (ses-cell-symbol row col)) 'ses-cell) :ses-named)
                sym
              (ses-create-cell-symbol row col)))
	;;Delete reference to a deleted cell
	nil))))