[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/project-switching 5a48ede 14/15: Adapt project functions to the
From: |
Simen Heggestøyl |
Subject: |
feature/project-switching 5a48ede 14/15: Adapt project functions to the new 'project-root' |
Date: |
Tue, 26 May 2020 11:43:19 -0400 (EDT) |
branch: feature/project-switching
commit 5a48ede3acb1f21a8dd6d56ebbc675b7225d28e5
Author: Simen Heggestøyl <address@hidden>
Commit: Simen Heggestøyl <address@hidden>
Adapt project functions to the new 'project-root'
* lisp/progmodes/project.el (project-dired, project-eshell)
(project--read-project-list, project--write-project-list)
(project--add-to-project-list-front)
(project--remove-from-project-list): Adapt to the new 'project-root'.
---
lisp/progmodes/project.el | 20 +++++++++-----------
1 file changed, 9 insertions(+), 11 deletions(-)
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 132d172..f00aca8 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -670,15 +670,13 @@ PREDICATE, HIST, and DEFAULT have the same meaning as in
(defun project-dired ()
"Open Dired in the current project."
(interactive)
- (let ((dirs (project-roots (project-current t))))
- (dired (car dirs))))
+ (dired (project-root (project-current t))))
;;;###autoload
(defun project-eshell ()
"Open Eshell in the current project."
(interactive)
- (let* ((dirs (project-roots (project-current t)))
- (default-directory (car dirs)))
+ (let ((default-directory (project-root (project-current t))))
(eshell t)))
(declare-function fileloop-continue "fileloop" ())
@@ -737,7 +735,7 @@ loop using the command \\[fileloop-continue]."
(let ((dirs (split-string (string-trim (buffer-string)) "\n"))
(project-list '()))
(dolist (dir dirs)
- (cl-pushnew (list (file-name-as-directory dir))
+ (cl-pushnew (file-name-as-directory dir)
project-list
:test #'equal))
(setq project--list (reverse project-list))))))
@@ -751,16 +749,16 @@ loop using the command \\[fileloop-continue]."
"Persist `project--list' to the project list file."
(let ((filename (locate-user-emacs-file "project-list")))
(with-temp-buffer
- (insert (string-join (mapcar #'car project--list) "\n"))
+ (insert (string-join project--list "\n"))
(write-region nil nil filename nil 'silent))))
(defun project--add-to-project-list-front (pr)
"Add project PR to the front of the project list and save it.
Return PR."
(project--ensure-read-project-list)
- (let ((dirs (project-roots pr)))
- (setq project--list (delete dirs project--list))
- (push dirs project--list))
+ (let ((dir (project-root pr)))
+ (setq project--list (delete dir project--list))
+ (push dir project--list))
(project--write-project-list)
pr)
@@ -771,8 +769,8 @@ result to disk."
(project--ensure-read-project-list)
;; XXX: This hardcodes that the number of roots = 1.
;; It's fine, though.
- (when (member (list pr-dir) project--list)
- (setq project--list (delete (list pr-dir) project--list))
+ (when (member pr-dir project--list)
+ (setq project--list (delete pr-dir project--list))
(message "Project `%s' not found; removed from list" pr-dir)
(project--write-project-list)))
- feature/project-switching 02e1ee9 06/15: Integrate project-switch-project with project-find-regexp, (continued)
- feature/project-switching 02e1ee9 06/15: Integrate project-switch-project with project-find-regexp, Simen Heggestøyl, 2020/05/26
- feature/project-switching 46bb2cb 07/15: Change dispatch binding of 'project-find-regexp', Simen Heggestøyl, 2020/05/26
- feature/project-switching 0db801a 11/15: Update the Emacs manual with recent project.el changes, Simen Heggestøyl, 2020/05/26
- feature/project-switching e37e6c8 13/15: Some copy edits, Simen Heggestøyl, 2020/05/26
- feature/project-switching 9f88356 02/15: Simplify a little, and avoid duplicate commands, Simen Heggestøyl, 2020/05/26
- feature/project-switching c6f56bd 08/15: Turn project switch menu var into a public alist, Simen Heggestøyl, 2020/05/26
- feature/project-switching 7082468 10/15: Rename 'project-switch-menu' to 'project-switch-commands', Simen Heggestøyl, 2020/05/26
- feature/project-switching 0b057ca 12/15: Teach project-current to inhibit the prompt, Simen Heggestøyl, 2020/05/26
- feature/project-switching 449810b 15/15: Avoid adding the empty string to the project list, Simen Heggestøyl, 2020/05/26
- feature/project-switching c6e80fd 09/15: Simplify 'project--keymap-prompt' a bit, Simen Heggestøyl, 2020/05/26
- feature/project-switching 5a48ede 14/15: Adapt project functions to the new 'project-root',
Simen Heggestøyl <=