Function: kotl-mode:goto-line
kotl-mode:goto-line is an interactive and byte-compiled function
defined in kotl-mode.el.
Signature
(kotl-mode:goto-line LINE &optional BUFFER RELATIVE)
Documentation
Go to LINE, counting from line 1 at beginning of buffer.
If called interactively, a numeric prefix argument specifies LINE; without a numeric prefix argument, read LINE from the minibuffer.
If optional argument BUFFER is non-nil, switch to that buffer and
move to line LINE there. If called interactively with C-u (universal-argument)
as argument, BUFFER is the most recently selected other buffer.
Optional argument RELATIVE is ignored and its value is always set to t, so counting starts at the beginning of the accessible portion of the narrowed Koutline buffer.
Prior to moving point, this function sets the mark (without activating it), unless Transient Mark mode is enabled and the mark is already active.
This function is usually the wrong thing to use in a Lisp program.
What you probably want instead is something like:
(goto-char (point-min))
(forward-line (1- N))
If at all possible, an even better solution is to use char counts
rather than line counts.
Key Bindings
Source Code
;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/kotl/kotl-mode.el
(defun kotl-mode:goto-line (line &optional buffer relative)
"Go to LINE, counting from line 1 at beginning of buffer.
If called interactively, a numeric prefix argument specifies
LINE; without a numeric prefix argument, read LINE from the
minibuffer.
If optional argument BUFFER is non-nil, switch to that buffer and
move to line LINE there. If called interactively with \\[universal-argument]
as argument, BUFFER is the most recently selected other buffer.
Optional argument RELATIVE is ignored and its value is always set to
t, so counting starts at the beginning of the accessible portion of
the narrowed Koutline buffer.
Prior to moving point, this function sets the mark (without
activating it), unless Transient Mark mode is enabled and the
mark is already active.
This function is usually the wrong thing to use in a Lisp program.
What you probably want instead is something like:
(goto-char (point-min))
(forward-line (1- N))
If at all possible, an even better solution is to use char counts
rather than line counts."
(declare (interactive-only forward-line))
(interactive (goto-line-read-args))
(setq relative t) ;; Always use relative lines in `kotl-mode'.
;; Switch to the desired buffer, one way or another.
(if buffer
(let ((window (get-buffer-window buffer)))
(if window (select-window window)
(switch-to-buffer-other-window buffer))))
;; Leave mark at previous position
(or (region-active-p) (push-mark))
;; Move to the specified line number in that buffer.
(let ((pos (save-restriction
(unless relative (widen))
(goto-char (point-min))
(if (eq selective-display t)
(re-search-forward "[\n\C-m]" nil 'end (1- line))
(forward-line (1- line)))
(point))))
(goto-char pos)
(kotl-mode:to-valid-position)))