unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] emacs: Use "r" key for 'cran' action in 'import' popup.
@ 2015-09-01 10:18 Alex Kost
  2015-09-02 13:10 ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Kost @ 2015-09-01 10:18 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 168 bytes --]

Hello, as now we have an importer for CRAN packages, there is a
duplication of "c" key in "M-x guix RET i".  I think that "r" will be a
good key for cran there, WDYT?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-emacs-Use-r-key-for-cran-action-in-import-popup.patch --]
[-- Type: text/x-patch, Size: 1207 bytes --]

From 1cc6871abf3d53ad5702fde5570df8a61a945010 Mon Sep 17 00:00:00 2001
From: Alex Kost <alezost@gmail.com>
Date: Tue, 1 Sep 2015 13:10:41 +0300
Subject: [PATCH] emacs: Use "r" key for 'cran' action in 'import' popup.

* emacs/guix-command.el (guix-command-improve-import-argument): New
  variable and function.
  (guix-command-argument-improvers): Add it.
---
 emacs/guix-command.el | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/emacs/guix-command.el b/emacs/guix-command.el
index 3513300..81f619f 100644
--- a/emacs/guix-command.el
+++ b/emacs/guix-command.el
@@ -209,6 +209,10 @@ to be modified."
   '(("--type" :fun guix-read-graph-type)))
 
 (guix-command-define-argument-improver
+    guix-command-improve-import-argument
+  '(("cran" :char ?r)))
+
+(guix-command-define-argument-improver
     guix-command-improve-import-elpa-argument
   '(("--archive" :fun guix-read-elpa-archive)))
 
@@ -275,6 +279,8 @@ to be modified."
      guix-command-improve-gc-argument)
     (("graph")
      guix-command-improve-graph-argument)
+    (("import")
+     guix-command-improve-import-argument)
     (("import" "gnu")
      guix-command-improve-key-policy-argument)
     (("import" "elpa")
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] emacs: Use "r" key for 'cran' action in 'import' popup.
  2015-09-01 10:18 [PATCH] emacs: Use "r" key for 'cran' action in 'import' popup Alex Kost
@ 2015-09-02 13:10 ` Ludovic Courtès
  2015-09-02 17:45   ` Alex Kost
  0 siblings, 1 reply; 4+ messages in thread
From: Ludovic Courtès @ 2015-09-02 13:10 UTC (permalink / raw)
  To: Alex Kost; +Cc: guix-devel

Alex Kost <alezost@gmail.com> skribis:

> From 1cc6871abf3d53ad5702fde5570df8a61a945010 Mon Sep 17 00:00:00 2001
> From: Alex Kost <alezost@gmail.com>
> Date: Tue, 1 Sep 2015 13:10:41 +0300
> Subject: [PATCH] emacs: Use "r" key for 'cran' action in 'import' popup.
>
> * emacs/guix-command.el (guix-command-improve-import-argument): New
>   variable and function.
>   (guix-command-argument-improvers): Add it.

Definitely.

Should there be some sort of automatic disambiguation mechanism?

Ludo’.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] emacs: Use "r" key for 'cran' action in 'import' popup.
  2015-09-02 13:10 ` Ludovic Courtès
@ 2015-09-02 17:45   ` Alex Kost
  2015-09-02 20:22     ` Ludovic Courtès
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Kost @ 2015-09-02 17:45 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guix-devel

Ludovic Courtès (2015-09-02 16:10 +0300) wrote:

> Alex Kost <alezost@gmail.com> skribis:
>
>> From 1cc6871abf3d53ad5702fde5570df8a61a945010 Mon Sep 17 00:00:00 2001
>> From: Alex Kost <alezost@gmail.com>
>> Date: Tue, 1 Sep 2015 13:10:41 +0300
>> Subject: [PATCH] emacs: Use "r" key for 'cran' action in 'import' popup.
>>
>> * emacs/guix-command.el (guix-command-improve-import-argument): New
>>   variable and function.
>>   (guix-command-argument-improvers): Add it.
>
> Definitely.
>
> Should there be some sort of automatic disambiguation mechanism?

Automatic?  I think it should be defined by a human what key to assign.
How can it be automatically decided what key should be used for "cpan"
and what for "cran"?  Currently the key is just defined by the first
letter and I think it is the maximal automatization that should be done.
If it's not enough, than we should solve disambiguation manually, don't
you agree?

Besides pressing these keys is not the only way to perform an action:
they are just buttons so you can use TAB + RET (or even mouse).

-- 
Alex

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] emacs: Use "r" key for 'cran' action in 'import' popup.
  2015-09-02 17:45   ` Alex Kost
@ 2015-09-02 20:22     ` Ludovic Courtès
  0 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2015-09-02 20:22 UTC (permalink / raw)
  To: Alex Kost; +Cc: guix-devel

Alex Kost <alezost@gmail.com> skribis:

> Ludovic Courtès (2015-09-02 16:10 +0300) wrote:
>
>> Alex Kost <alezost@gmail.com> skribis:
>>
>>> From 1cc6871abf3d53ad5702fde5570df8a61a945010 Mon Sep 17 00:00:00 2001
>>> From: Alex Kost <alezost@gmail.com>
>>> Date: Tue, 1 Sep 2015 13:10:41 +0300
>>> Subject: [PATCH] emacs: Use "r" key for 'cran' action in 'import' popup.
>>>
>>> * emacs/guix-command.el (guix-command-improve-import-argument): New
>>>   variable and function.
>>>   (guix-command-argument-improvers): Add it.
>>
>> Definitely.
>>
>> Should there be some sort of automatic disambiguation mechanism?
>
> Automatic?  I think it should be defined by a human what key to assign.
> How can it be automatically decided what key should be used for "cpan"
> and what for "cran"?  Currently the key is just defined by the first
> letter and I think it is the maximal automatization that should be done.
> If it's not enough, than we should solve disambiguation manually, don't
> you agree?

Yes, you’re right.  Doing things automatically would have the advantage
of not missing collisions, but doing it sensibly may prove to be hard,
as you note.

Ludo’.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-09-02 20:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-01 10:18 [PATCH] emacs: Use "r" key for 'cran' action in 'import' popup Alex Kost
2015-09-02 13:10 ` Ludovic Courtès
2015-09-02 17:45   ` Alex Kost
2015-09-02 20:22     ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.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).