Add optional RELPOS argument to ein:cell-goto

This commit is contained in:
Takafumi Arakaki 2012-07-21 14:32:11 +02:00
parent 34a10d38b5
commit 3934f8471a

View file

@ -594,10 +594,13 @@ Called from ewoc pretty printer via `ein:cell-pp'."
(message (ein:trim (ansi-color-apply defstring))))))
(ein:log 'info "no info for %s" name))))
(defmethod ein:cell-goto ((cell ein:basecell))
(defmethod ein:cell-goto ((cell ein:basecell) &optional relpos)
"Go to the input area of the given CELL.
RELPOS is the position relative to the input area. Default is 0."
(unless relpos (setq relpos 0))
(ewoc-goto-node (oref cell :ewoc) (ein:cell-element-get cell :input))
;; Skip the newline
(forward-char))
;; `1+' to skip the newline
(forward-char (1+ relpos)))
(defmethod ein:cell-relative-point ((cell ein:basecell) &optional pos)
"Return the point relative to the input area of CELL.