Function: proced--determine-pos
proced--determine-pos is a byte-compiled function defined in
proced.el.gz.
Signature
(proced--determine-pos KEY COLUMN)
Documentation
Return position of point in the current line using KEY and COLUMN.
Attempt to find the first position on the current line where the text property proced-key is equal to KEY. If this is not possible, return the position of point of column COLUMN on the current line.
Source Code
;; Defined in /usr/src/emacs/lisp/proced.el.gz
(defun proced--determine-pos (key column)
"Return position of point in the current line using KEY and COLUMN.
Attempt to find the first position on the current line where the
text property proced-key is equal to KEY. If this is not possible, return
the position of point of column COLUMN on the current line."
(save-excursion
(let (new-pos)
(if key
(let ((limit (line-end-position)) pos)
(while (and (not new-pos)
(setq pos (next-property-change (point) nil limit)))
(goto-char pos)
(when (eq key (get-text-property (point) 'proced-key))
(forward-char (min column (- (next-property-change (point))
(point))))
(setq new-pos (point))))
(unless new-pos
;; we found the process, but the field of point
;; is not listed anymore
(setq new-pos (proced-move-to-goal-column))))
(setq new-pos (min (+ (line-beginning-position) column)
(line-end-position))))
new-pos)))