]> git.eshelyaron.com Git - emacs.git/commitdiff
project-list-file: New user option
authorDmitry Gutov <dgutov@yandex.ru>
Tue, 2 Jun 2020 21:27:29 +0000 (00:27 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Tue, 2 Jun 2020 21:27:29 +0000 (00:27 +0300)
* lisp/progmodes/project.el (project): New custom group.
(project-vc): Use it as parent.
(project-vc-merge-submodules): Tag with Emacs version.
(project-read-file-name-function): Assign to the 'project' group.
(project-list-file): New user option (bug#41600).
(project--write-project-list, project--read-project-list): Use it.

lisp/progmodes/project.el

index 0051a84ff846b34f550dd117b7e4c3fe6ef7e826..1c4dc7e7617363d0b5ff83932cd5734e3c30af5d 100644 (file)
 (require 'cl-generic)
 (eval-when-compile (require 'subr-x))
 
+(defgroup project nil
+  "Operations on the current project."
+  :group 'tools)
+
 (defvar project-find-functions (list #'project-try-vc)
   "Special hook to find the project containing a given directory.
 Each functions on this hook is called in turn with one
@@ -236,7 +240,7 @@ to find the list of ignores for each directory."
 (defgroup project-vc nil
   "Project implementation based on the VC package."
   :version "25.1"
-  :group 'tools)
+  :group 'project)
 
 (defcustom project-vc-ignores nil
   "List of patterns to include in `project-ignores'."
@@ -249,6 +253,7 @@ to find the list of ignores for each directory."
 After changing this variable (using Customize or .dir-locals.el)
 you might have to restart Emacs to see the effect."
   :type 'boolean
+  :version "28.1"
   :package-version '(project . "0.2.0")
   :safe 'booleanp)
 
@@ -601,6 +606,7 @@ For the arguments list, see `project--read-file-cpd-relative'."
                  (const :tag "Read with completion from absolute names"
                         project--read-file-absolute)
                  (function :tag "Custom function" nil))
+  :group 'project
   :version "27.1")
 
 (defun project--read-file-cpd-relative (prompt
@@ -740,12 +746,17 @@ Arguments the same as in `compile'."
 \f
 ;;; Project list
 
+(defcustom project-list-file (locate-user-emacs-file "project-list")
+  "File to save the list of known projects."
+  :type 'string
+  :group 'project)
+
 (defvar project--list 'unset
   "List of known project directories.")
 
 (defun project--read-project-list ()
   "Initialize `project--list' from the project list file."
-  (let ((filename (locate-user-emacs-file "project-list")))
+  (let ((filename project-list-file))
     (setq project--list
           (when (file-exists-p filename)
             (with-temp-buffer
@@ -765,7 +776,7 @@ Arguments the same as in `compile'."
 
 (defun project--write-project-list ()
   "Persist `project--list' to the project list file."
-  (let ((filename (locate-user-emacs-file "project-list")))
+  (let ((filename project-list-file))
     (with-temp-buffer
       (insert (string-join project--list "\n"))
       (write-region nil nil filename nil 'silent))))