From: Eshel Yaron <me@eshelyaron.com>
To: emacs-devel@gnu.org
Cc: Dmitry Gutov <dmitry@gutov.dev>
Subject: Re: master 9904376c797: Support calling 'project-current' with custom prompt
Date: Wed, 23 Oct 2024 08:54:55 +0200 [thread overview]
Message-ID: <m14j53ia0w.fsf@macbookpro.home> (raw)
In-Reply-To: <20241007230633.CC7E91EAF92@vcs3.savannah.gnu.org> (Dmitry Gutov's message of "Mon, 7 Oct 2024 19:06:33 -0400 (EDT)")
Hi Dmitry,
Dmitry Gutov <dgutov@yandex.ru> writes:
> branch: master
> commit 9904376c797665de47ff760bcf8c2fe33d7ae625
> Author: Dmitry Gutov <dmitry@gutov.dev>
> Commit: Dmitry Gutov <dmitry@gutov.dev>
>
> Support calling 'project-current' with custom prompt
>
[...]
> - (setq directory (funcall project-prompter)
> + (setq directory (if (stringp maybe-prompt)
> + (funcall project-prompter maybe-prompt)
> + (funcall project-prompter))
JFYI, I'm using a custom project-prompter, which was not prepared to be
called with an argument, so I got some unexpected errors until I
realized what changed. A quick lookup online shows that although this
option is quite new, a few others already set it to a custom function,
so it might be worth catching the "Wrong number of arguments" error.
Also, I'd like to update the docstring of project-prompter along the
following lines, if it looks right to you:
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 3cdaa7c2a76..6383bdc95d2 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -199,7 +199,9 @@ project-current-directory-override
(defcustom project-prompter #'project-prompt-project-dir
"Function to call to prompt for a project.
-Called with no arguments and should return a project root dir."
+The function is either called with no arguments or with one argument,
+which is the prompt string to use when prompting. It should return a
+project root directory."
:type '(choice (const :tag "Prompt for a project directory"
project-prompt-project-dir)
(const :tag "Prompt for a project name"
Cheers,
Eshel
next parent reply other threads:[~2024-10-23 6:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <172834239339.3048552.12080367051270999761@vcs3.savannah.gnu.org>
[not found] ` <20241007230633.CC7E91EAF92@vcs3.savannah.gnu.org>
2024-10-23 6:54 ` Eshel Yaron [this message]
2024-10-23 19:51 ` master 9904376c797: Support calling 'project-current' with custom prompt Dmitry Gutov
2024-10-24 7:30 ` Eshel Yaron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m14j53ia0w.fsf@macbookpro.home \
--to=me@eshelyaron.com \
--cc=dmitry@gutov.dev \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.