From: Dmitry Gutov <dgutov@yandex.ru>
To: Philip Kaludercic <philipk@posteo.net>,
Ivan Sokolov <ivan-p-sokolov@ya.ru>
Cc: emacs-devel@gnu.org
Subject: Re: Add project-name function
Date: Sat, 6 Mar 2021 22:22:22 +0200 [thread overview]
Message-ID: <3a860f4f-2325-9bea-991d-75d2831a7372@yandex.ru> (raw)
In-Reply-To: <87wnuknzjf.fsf@posteo.net>
Hi Ivan and Philip,
On 06.03.2021 16:10, Philip Kaludercic wrote:
> Ivan Sokolov<ivan-p-sokolov@ya.ru> writes:
>
>> I hope I am doing everything right, this is my first patch for Emacs.
>>
>> From 0aa1b0417f2fd4f8fdef24194c55304611711cfa Mon Sep 17 00:00:00 2001
>> From: Ivan Sokolov<ivan-p-sokolov@ya.ru>
>> Date: Sat, 6 Mar 2021 01:43:30 +0300
>> Subject: [PATCH] lisp/progmodes/project.el: Add 'project-name'
>>
>> ---
>> lisp/progmodes/project.el | 23 +++++++++++++----------
>> 1 file changed, 13 insertions(+), 10 deletions(-)
>>
>> diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
>> index abe563bec0..3abae8606f 100644
>> --- a/lisp/progmodes/project.el
>> +++ b/lisp/progmodes/project.el
>> @@ -888,6 +888,13 @@ PREDICATE, HIST, and DEFAULT have the same meaning as in
>> (interactive)
>> (vc-dir (project-root (project-current t))))
>>
>> +;;;###autoload
>> +(defun project-name (project)
>> + "Return PROJECT's name."
> Without reading the rest of the code, I wasn't sure what a project's
> name is. I think the docstring should explain that it just takes the
> basename of the root directory.
>
> It might be worth considering turning this into a method, in case a
> project knows a better name.
The patch submission is fine (even though using the bug tracker next
time would be preferable), and the point about the generic method is a
good one too.
But I generally prefer to add new features to the API together with some
accompanying usages inside the core. While the patch does that, we're
currently discussing how to change both of the affected functions in a
different way, and that change seems to be incompatible with the use of
'project-name' in them.
Check this thread out:
https://lists.gnu.org/archive/html/emacs-devel/2021-03/msg00083.html
What do you think about the behavior proposed there?
next prev parent reply other threads:[~2021-03-06 20:22 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-05 22:48 Add project-name function Ivan Sokolov
2021-03-06 14:10 ` Philip Kaludercic
2021-03-06 20:22 ` Dmitry Gutov [this message]
2021-03-06 20:51 ` Ivan Sokolov
2021-03-06 20:53 ` Add " Ivan Sokolov
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=3a860f4f-2325-9bea-991d-75d2831a7372@yandex.ru \
--to=dgutov@yandex.ru \
--cc=emacs-devel@gnu.org \
--cc=ivan-p-sokolov@ya.ru \
--cc=philipk@posteo.net \
/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.