unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Rudolf Schlatte <rudi@constantly.at>
To: 45134@debbugs.gnu.org
Subject: bug#45134: Add project-switch-project-by-name
Date: Wed, 09 Dec 2020 16:42:23 +0100	[thread overview]
Message-ID: <m2v9dbyoio.fsf@constantly.at> (raw)
In-Reply-To: <m2lfe7j9jk.fsf@constantly.at>

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Rudolf Schlatte <rudi@constantly.at> writes:
>
>> Certain “dashboard-type” packages present a list of projects and let the
>> user switch to one of them.  In that case, the project root is already
>> known, and project.el only needs to present the dispatch menu of
>> ‘project-switch-commands’.  As an example, see
>> ‘dashboard-projects-switch-function’ at
>> https://github.com/emacs-dashboard/emacs-dashboard/blob/75f0c46db03b40ec983dbf4aa81e2ccb2e4a16ef/dashboard-widgets.el#L696
>>
>> This patch adds a function ‘project-switch-project-by-name’, analogous
>> to ‘projectile-switch-project-by-name’.  I hope the diff makes it
>> through unmangled..
>
> Makes sense to me.
>
>> +(defun project-switch-project-by-name (project-root)
>> +  "\"Switch\" to the project in PROJECT-ROOT and run an Emacs command.
>
> But is this the best name for this function?  PROJECT-ROOT isn't the
> name of the project, but a directory.

You mean the argument name?  Fine with renaming that - PROJECT-DIR or
DIR are all ok (DIR is used in ‘project-switch-project’ just above the
added function, so maybe that’s best).

Even though the argument is a directory, I chose the function name
‘project-switch-project-by-name’ to stay close to projectile, which uses
‘projectile-switch-project-by-name’ for the analogous function.






  reply	other threads:[~2020-12-09 15:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-09 15:14 bug#45134: Add project-switch-project-by-name Rudolf Schlatte
2020-12-09 15:21 ` Lars Ingebrigtsen
2020-12-09 15:42   ` Rudolf Schlatte [this message]
2020-12-09 15:47     ` Rudolf Schlatte
2020-12-09 19:36 ` Dmitry Gutov
2020-12-09 20:21   ` Rudolf Schlatte
2020-12-09 20:57     ` Dmitry Gutov

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2v9dbyoio.fsf@constantly.at \
    --to=rudi@constantly.at \
    --cc=45134@debbugs.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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).