Function: project--remember-dir

project--remember-dir is a byte-compiled function defined in project.el.gz.

Signature

(project--remember-dir ROOT &optional NO-WRITE STABLE)

Documentation

Add project root ROOT to the front of the project list.

Save the result in project-list-file if the list of projects has changed, unless NO-WRITE is non-nil. If STABLE is non-nil, don't move ROOT to the front of the project list if it's already present further down the project list.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/project.el.gz
(defun project--remember-dir (root &optional no-write stable)
  "Add project root ROOT to the front of the project list.
Save the result in `project-list-file' if the list of projects
has changed, unless NO-WRITE is non-nil.
If STABLE is non-nil, don't move ROOT to the front of the project list
if it's already present further down the project list."
  (project--ensure-read-project-list)
  (let ((dir (abbreviate-file-name root)))
    (unless (if stable (assoc dir project--list)
              (equal (caar project--list) dir))
      (unless stable
        (dolist (ent project--list)
          (when (equal dir (car ent))
            (setq project--list (delq ent project--list)))))
      (push (list dir) project--list)
      (unless no-write
        (project--write-project-list)))))