Function: projectile--parse-dirconfig-file-uncached

projectile--parse-dirconfig-file-uncached is a byte-compiled function defined in projectile.el.

Signature

(projectile--parse-dirconfig-file-uncached)

Documentation

Parse the dirconfig file without caching.

Returns a list of (KEEP IGNORE ENSURE) or nil if the file doesn't exist.

Source Code

;; Defined in ~/.emacs.d/elpa/projectile-20260310.858/projectile.el
(defun projectile--parse-dirconfig-file-uncached ()
  "Parse the dirconfig file without caching.
Returns a list of (KEEP IGNORE ENSURE) or nil if the file doesn't exist."
  (let (keep ignore ensure (dirconfig (projectile-dirconfig-file)))
    (when (projectile-file-exists-p dirconfig)
      (with-temp-buffer
        (insert-file-contents dirconfig)
        (while (not (eobp))
          (pcase (char-after)
            ;; ignore comment lines if prefix char has been set
            ((pred (lambda (leading-char)
                     (and projectile-dirconfig-comment-prefix
                          (eql leading-char
                               projectile-dirconfig-comment-prefix))))
             nil)
            (?+ (push (buffer-substring (1+ (point)) (line-end-position)) keep))
            (?- (push (buffer-substring (1+ (point)) (line-end-position)) ignore))
            (?! (push (buffer-substring (1+ (point)) (line-end-position)) ensure))
            (_ (push (buffer-substring (point) (line-end-position)) ignore)))
          (forward-line)))
      (list (mapcar (lambda (f) (file-name-as-directory (string-trim f)))
                    (delete "" (reverse keep)))
            (mapcar #'string-trim
                    (delete "" (reverse ignore)))
            (mapcar #'string-trim
                    (delete "" (reverse ensure)))))))