* [PATCH] piem-inbox-coderepo-maybe-read: Support project.el
@ 2021-02-02 19:32 Xinglu Chen
2021-02-02 19:45 ` Xinglu Chen
2021-02-02 23:43 ` Kyle Meyer
0 siblings, 2 replies; 4+ messages in thread
From: Xinglu Chen @ 2021-02-02 19:32 UTC (permalink / raw)
To: piem
Add support for reading directory using project.el.
project.el is a built-in library that offers similar functionality to
projectile. It is also available on GNU ELPA.
---
piem.el | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/piem.el b/piem.el
index 7b198d1..b07c4f3 100644
--- a/piem.el
+++ b/piem.el
@@ -372,6 +372,11 @@ (defun piem-inbox-coderepo-maybe-read ()
(when-let ((current (and (fboundp 'projectile-project-root)
(projectile-project-root))))
(abbreviate-file-name current)))))
+ (and (bound-and-true-p project-list-file)
+ (file-exists-p project-list-file)
+ (expand-file-name
+ (when (fboundp 'project-prompt-project-dir)
+ (project-prompt-project-dir))))
(and piem-use-magit
(fboundp 'magit-read-repository)
(magit-read-repository))
base-commit: 656625e1f9628673c285e3357329aaa6f6e48843
--
2.29.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] piem-inbox-coderepo-maybe-read: Support project.el
2021-02-02 19:32 [PATCH] piem-inbox-coderepo-maybe-read: Support project.el Xinglu Chen
@ 2021-02-02 19:45 ` Xinglu Chen
2021-02-02 23:42 ` Kyle Meyer
2021-02-02 23:43 ` Kyle Meyer
1 sibling, 1 reply; 4+ messages in thread
From: Xinglu Chen @ 2021-02-02 19:45 UTC (permalink / raw)
To: piem
Sorry, forgot to add the "--reply-to" header.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] piem-inbox-coderepo-maybe-read: Support project.el
2021-02-02 19:32 [PATCH] piem-inbox-coderepo-maybe-read: Support project.el Xinglu Chen
2021-02-02 19:45 ` Xinglu Chen
@ 2021-02-02 23:43 ` Kyle Meyer
1 sibling, 0 replies; 4+ messages in thread
From: Kyle Meyer @ 2021-02-02 23:43 UTC (permalink / raw)
To: Xinglu Chen; +Cc: piem
Xinglu Chen writes:
> diff --git a/piem.el b/piem.el
> index 7b198d1..b07c4f3 100644
> --- a/piem.el
> +++ b/piem.el
> @@ -372,6 +372,11 @@ (defun piem-inbox-coderepo-maybe-read ()
> (when-let ((current (and (fboundp 'projectile-project-root)
> (projectile-project-root))))
> (abbreviate-file-name current)))))
> + (and (bound-and-true-p project-list-file)
> + (file-exists-p project-list-file)
> + (expand-file-name
> + (when (fboundp 'project-prompt-project-dir)
> + (project-prompt-project-dir))))
Untested on my end, but looks good. I've moved the fboundp call above
expand-file-name (diff below). That's mostly just a cosmetic
preference, though if project-prompt-project-dir were ever
dropped/renamed, it'd also prevent a type error by avoiding
(expand-file-name nil).
Pushed (c468c6b). Thanks!
diff --git a/piem.el b/piem.el
index b07c4f3..99c1937 100644
--- a/piem.el
+++ b/piem.el
@@ -374,9 +374,9 @@ (defun piem-inbox-coderepo-maybe-read ()
(abbreviate-file-name current)))))
(and (bound-and-true-p project-list-file)
(file-exists-p project-list-file)
+ (fboundp 'project-prompt-project-dir)
(expand-file-name
- (when (fboundp 'project-prompt-project-dir)
- (project-prompt-project-dir))))
+ (project-prompt-project-dir)))
(and piem-use-magit
(fboundp 'magit-read-repository)
(magit-read-repository))
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-02-02 23:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-02 19:32 [PATCH] piem-inbox-coderepo-maybe-read: Support project.el Xinglu Chen
2021-02-02 19:45 ` Xinglu Chen
2021-02-02 23:42 ` Kyle Meyer
2021-02-02 23:43 ` Kyle Meyer
Code repositories for project(s) associated with this public inbox
https://git.kyleam.com/piem/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).