Function: insert-directory-adj-pos

insert-directory-adj-pos is a byte-compiled function defined in files.el.gz.

Signature

(insert-directory-adj-pos POS ERROR-LINES)

Documentation

Convert ls --dired file name position value POS to a buffer position.

File name position values returned in ls --dired output count only stdout; they don't count the error messages sent to stderr. So this function converts to them to real buffer positions. ERROR-LINES is a list of buffer positions of error message lines, of the form (START END).

Source Code

;; Defined in /usr/src/emacs/lisp/files.el.gz
(defun insert-directory-adj-pos (pos error-lines)
  "Convert `ls --dired' file name position value POS to a buffer position.
File name position values returned in ls --dired output
count only stdout; they don't count the error messages sent to stderr.
So this function converts to them to real buffer positions.
ERROR-LINES is a list of buffer positions of error message lines,
of the form (START END)."
  (while (and error-lines (< (caar error-lines) pos))
    (setq pos (+ pos (- (nth 1 (car error-lines)) (nth 0 (car error-lines)))))
    (pop error-lines))
  pos)