bug#41890: 28.0.50; [PATCH]: Add bindings for project.el

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#41890: 28.0.50; [PATCH]: Add bindings for project.el

Simen Heggestøyl-3
"Philip K." <[hidden email]> writes:

> Simen Heggestøyl <[hidden email]> writes:
>
>> My only gripe would be that it makes it a bit harder to add new
>> commands, since it now requires modifying both project-switch-commands
>> and project-prefix\-map.
>
> As in for developers, when they want to contribute a new project-*
> function or users who want to just change stuff (I know the line might
> be blury)?

The latter. For the former case I think it's fine.

>> Maybe we could reintroduce the helper function we had for that purpose
>> earlier.
>
> I missed when this happened. In what commit was it removed, or was it
> just in a patch?

Sorry, yes, it was just a patch. Maybe it could look something like
this:

;;;###autoload
(defun project-add-switch-command (key command label)
  (define-key project-prefix-map key command)
  (add-to-list 'project-switch-commands (list command label) t))

-- Simen



Reply | Threaded
Open this post in threaded view
|

bug#41890: 28.0.50; [PATCH]: Add bindings for project.el

Dmitry Gutov
On 19.06.2020 13:50, Simen Heggestøyl wrote:

>>> My only gripe would be that it makes it a bit harder to add new
>>> commands, since it now requires modifying both project-switch-commands
>>> and project-prefix\-map.
>> As in for developers, when they want to contribute a new project-*
>> function or users who want to just change stuff (I know the line might
>> be blury)?
> The latter. For the former case I think it's fine.
>
>>> Maybe we could reintroduce the helper function we had for that purpose
>>> earlier.
>> I missed when this happened. In what commit was it removed, or was it
>> just in a patch?
> Sorry, yes, it was just a patch. Maybe it could look something like
> this:
>
> ;;;###autoload
> (defun project-add-switch-command (key command label)
>    (define-key project-prefix-map key command)
>    (add-to-list 'project-switch-commands (list command label) t))

Not sure the above will change things too much. It's a function, not a
Customize interface (which could be added for the current format of
project-switch-commands), and its valid values would have to be
documented and understood by the user anyway. We could as well put its
body in the documentation as customization instructions.

Now, I think the current setup is pretty good already. The extra
capability that the patch brings will be the ability to turn on
project-switch-use-entire-map in their local configs.

Are there people here who intend to do that?