All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Home-End keys in menu
@ 2008-07-21 18:07 Carles Pina i Estany
  2008-08-05 12:02 ` Carles Pina i Estany
  0 siblings, 1 reply; 12+ messages in thread
From: Carles Pina i Estany @ 2008-07-21 18:07 UTC (permalink / raw)
  To: grub-devel

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



Hello,

Last weekend we talked about "menu loop" (wrapping):
http://lists.gnu.org/archive/html/grub-devel/2008-07/msg00319.html

Conclusion: people here don't like it (we could discuss for ages, I
think :-) )

Second proposal that maybe was hidden in so much text: to make it to
work Home and End keys. Patch is attached. Do you need a more formal
changelog for this? Adds Home and End key moving.
Comments are welcomed.

Commend: I think that would be possible to change "case 14" by "case
GRUB_TERM_DOWN"; and "case 16" by "case GRUB_TERM_UP" in normal/menu.c
line 400 aprox. These constants are defined in include/grub/term.h. I
don't send a patch because it's in the same "zone" than attached patch
and it's easy-easy.

Thanks for your patience,

-- 
Carles Pina i Estany		GPG id: 0x8CBDAE64
	http://pinux.info	Manresa - Barcelona

[-- Attachment #2: home_end.patch --]
[-- Type: text/x-diff, Size: 675 bytes --]

Index: normal/menu.c
===================================================================
--- normal/menu.c	(revision 1718)
+++ normal/menu.c	(working copy)
@@ -405,6 +405,22 @@
 	  
 	  switch (c)
 	    {
+            case GRUB_TERM_HOME:
+	       first=0;
+	       offset=0;
+	       print_entries (menu, first, offset);
+	       break;
+
+	    case GRUB_TERM_END:
+	      offset = menu->size - 1;
+	      if (offset > GRUB_TERM_NUM_ENTRIES - 1)
+		{
+                  first = offset - (GRUB_TERM_NUM_ENTRIES - 1);
+		  offset = GRUB_TERM_NUM_ENTRIES - 1;
+		}
+		print_entries (menu, first, offset);
+	      break;
+
 	    case 16:
 	    case '^':
 	      if (offset > 0)

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

* Re: [PATCH] Home-End keys in menu
  2008-07-21 18:07 [PATCH] Home-End keys in menu Carles Pina i Estany
@ 2008-08-05 12:02 ` Carles Pina i Estany
  2008-08-05 13:16   ` Marco Gerards
  0 siblings, 1 reply; 12+ messages in thread
From: Carles Pina i Estany @ 2008-08-05 12:02 UTC (permalink / raw)
  To: grub-devel

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


Hello,

Some weeks ago I sent a patch that didn't have any discussion. I'm
sending it again, maybe everybody was in holidays :-)

Actually I updated the patch (added some spaces to comply with the
coding style).

* menu/normal.c: Add Home and End keys in grub-menu

Also, I added a comment that would be nice to change some magic numbers
to constants that already exists.

(I feel that it's a insignifcant patch compared with what I have seen
here!)

Thank you,

On Jul/21/2008, Carles Pina i Estany wrote:
> 
> 
> Hello,
> 
> Last weekend we talked about "menu loop" (wrapping):
> http://lists.gnu.org/archive/html/grub-devel/2008-07/msg00319.html
> 
> Conclusion: people here don't like it (we could discuss for ages, I
> think :-) )
> 
> Second proposal that maybe was hidden in so much text: to make it to
> work Home and End keys. Patch is attached. Do you need a more formal
> changelog for this? Adds Home and End key moving.
> Comments are welcomed.
> 
> Commend: I think that would be possible to change "case 14" by "case
> GRUB_TERM_DOWN"; and "case 16" by "case GRUB_TERM_UP" in normal/menu.c
> line 400 aprox. These constants are defined in include/grub/term.h. I
> don't send a patch because it's in the same "zone" than attached patch
> and it's easy-easy.
> 
> Thanks for your patience,
> 
> -- 
> Carles Pina i Estany		GPG id: 0x8CBDAE64
> 	http://pinux.info	Manresa - Barcelona

> Index: normal/menu.c
> ===================================================================
> --- normal/menu.c	(revision 1718)
> +++ normal/menu.c	(working copy)
> @@ -405,6 +405,22 @@
>  	  
>  	  switch (c)
>  	    {
> +            case GRUB_TERM_HOME:
> +	       first=0;
> +	       offset=0;
> +	       print_entries (menu, first, offset);
> +	       break;
> +
> +	    case GRUB_TERM_END:
> +	      offset = menu->size - 1;
> +	      if (offset > GRUB_TERM_NUM_ENTRIES - 1)
> +		{
> +                  first = offset - (GRUB_TERM_NUM_ENTRIES - 1);
> +		  offset = GRUB_TERM_NUM_ENTRIES - 1;
> +		}
> +		print_entries (menu, first, offset);
> +	      break;
> +
>  	    case 16:
>  	    case '^':
>  	      if (offset > 0)

> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel

-- 
Carles Pina i Estany		GPG id: 0x17756391
	http://pinux.info

[-- Attachment #2: home_end2.patch --]
[-- Type: text/x-diff, Size: 679 bytes --]

Index: normal/menu.c
===================================================================
--- normal/menu.c	(revision 1774)
+++ normal/menu.c	(working copy)
@@ -405,6 +405,22 @@
 	  
 	  switch (c)
 	    {
+            case GRUB_TERM_HOME:
+	       first = 0;
+	       offset = 0;
+	       print_entries (menu, first, offset);
+	       break;
+
+	    case GRUB_TERM_END:
+	      offset = menu->size - 1;
+	      if (offset > GRUB_TERM_NUM_ENTRIES - 1)
+		{
+                  first = offset - (GRUB_TERM_NUM_ENTRIES - 1);
+		  offset = GRUB_TERM_NUM_ENTRIES - 1;
+		}
+		print_entries (menu, first, offset);
+	      break;
+
 	    case 16:
 	    case '^':
 	      if (offset > 0)

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

* Re: [PATCH] Home-End keys in menu
  2008-08-05 12:02 ` Carles Pina i Estany
@ 2008-08-05 13:16   ` Marco Gerards
  2008-08-06 18:31     ` Carles Pina i Estany
  0 siblings, 1 reply; 12+ messages in thread
From: Marco Gerards @ 2008-08-05 13:16 UTC (permalink / raw)
  To: The development of GRUB 2

Hi,

Carles Pina i Estany <carles@pina.cat> writes:

> Some weeks ago I sent a patch that didn't have any discussion. I'm
> sending it again, maybe everybody was in holidays :-)
>
> Actually I updated the patch (added some spaces to comply with the
> coding style).
>
> * menu/normal.c: Add Home and End keys in grub-menu

The first line of the changelog entry is missing (name + e-mail
address).  Please mention the function you change like:

 * menu/normal.c (foo): Blah blah.

And end a sentence with a "."

>> Index: normal/menu.c
>> ===================================================================
>> --- normal/menu.c	(revision 1718)
>> +++ normal/menu.c	(working copy)
>> @@ -405,6 +405,22 @@
>>  	  
>>  	  switch (c)
>>  	    {
>> +            case GRUB_TERM_HOME:
>> +	       first=0;
>> +	       offset=0;
>> +	       print_entries (menu, first, offset);
>> +	       break;

The indentation of the case statement doesn't seem right...

>> +	    case GRUB_TERM_END:
>> +	      offset = menu->size - 1;
>> +	      if (offset > GRUB_TERM_NUM_ENTRIES - 1)
>> +		{
>> +                  first = offset - (GRUB_TERM_NUM_ENTRIES - 1);
>> +		  offset = GRUB_TERM_NUM_ENTRIES - 1;

This indentation also looks funny...

>> +		}
>> +		print_entries (menu, first, offset);
>> +	      break;
>> +
>>  	    case 16:
>>  	    case '^':
>>  	      if (offset > 0)
>
>> _______________________________________________
>> Grub-devel mailing list
>> Grub-devel@gnu.org
>> http://lists.gnu.org/mailman/listinfo/grub-devel
>
> -- 
> Carles Pina i Estany		GPG id: 0x17756391
> 	http://pinux.info
>
> _______________________________________________
> Grub-devel mailing list
> Grub-devel@gnu.org
> http://lists.gnu.org/mailman/listinfo/grub-devel




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

* Re: [PATCH] Home-End keys in menu
  2008-08-05 13:16   ` Marco Gerards
@ 2008-08-06 18:31     ` Carles Pina i Estany
  2008-08-13 10:15       ` Marco Gerards
  0 siblings, 1 reply; 12+ messages in thread
From: Carles Pina i Estany @ 2008-08-06 18:31 UTC (permalink / raw)
  To: The development of GRUB 2

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



Hello,

On Aug/05/2008, Marco Gerards wrote:

> > Some weeks ago I sent a patch that didn't have any discussion. I'm
> > sending it again, maybe everybody was in holidays :-)
> >
> > Actually I updated the patch (added some spaces to comply with the
> > coding style).
> >
> > * menu/normal.c: Add Home and End keys in grub-menu
> 
> The first line of the changelog entry is missing (name + e-mail
> address).  Please mention the function you change like:

done! (see below)

[...]

> The indentation of the case statement doesn't seem right...

[...]

> This indentation also looks funny...

was not right (not a problem, it's fixed now).

Also, the indentation got worst in the mail :-)

Changelog:
-------
2008-08-06  Carles Pina i Estany  <carles@pina.cat>

	* menu/normal.c (run_menu): Add Home and End keys in grub-menu.
-------

Patch is attached.

Thank you,

-- 
Carles Pina i Estany		GPG id: 0x17756391
	http://pinux.info

[-- Attachment #2: home_end3.patch --]
[-- Type: text/x-diff, Size: 654 bytes --]

Index: normal/menu.c
===================================================================
--- normal/menu.c	(revision 1786)
+++ normal/menu.c	(working copy)
@@ -405,6 +405,22 @@
 	  
 	  switch (c)
 	    {
+	    case GRUB_TERM_HOME:
+	      first = 0;
+	      offset = 0;
+	      print_entries (menu, first, offset);
+	      break;
+
+	    case GRUB_TERM_END:
+	      offset = menu->size - 1;
+	      if (offset > GRUB_TERM_NUM_ENTRIES - 1)
+		{
+		  first = offset - (GRUB_TERM_NUM_ENTRIES - 1);
+		  offset = GRUB_TERM_NUM_ENTRIES - 1;
+		}
+		print_entries (menu, first, offset);
+	      break;
+
 	    case 16:
 	    case '^':
 	      if (offset > 0)

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

* Re: [PATCH] Home-End keys in menu
  2008-08-06 18:31     ` Carles Pina i Estany
@ 2008-08-13 10:15       ` Marco Gerards
  2008-08-13 10:50         ` Robert Millan
  2008-08-16 18:51         ` Carles Pina i Estany
  0 siblings, 2 replies; 12+ messages in thread
From: Marco Gerards @ 2008-08-13 10:15 UTC (permalink / raw)
  To: The development of GRUB 2

Hi,

Carles Pina i Estany <carles@pina.cat> writes:

[...]

> 2008-08-06  Carles Pina i Estany  <carles@pina.cat>
>
> 	* menu/normal.c (run_menu): Add Home and End keys in grub-menu.


This looks fine to me at first sight.  Do others have problems with
this?  Otherwise it can be committed.

--
Marco




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

* Re: [PATCH] Home-End keys in menu
  2008-08-13 10:15       ` Marco Gerards
@ 2008-08-13 10:50         ` Robert Millan
  2008-08-13 11:06           ` Marco Gerards
  2008-08-13 11:38           ` Javier Martín
  2008-08-16 18:51         ` Carles Pina i Estany
  1 sibling, 2 replies; 12+ messages in thread
From: Robert Millan @ 2008-08-13 10:50 UTC (permalink / raw)
  To: The development of GRUB 2

On Wed, Aug 13, 2008 at 12:15:37PM +0200, Marco Gerards wrote:
> Hi,
> 
> Carles Pina i Estany <carles@pina.cat> writes:
> 
> [...]
> 
> > 2008-08-06  Carles Pina i Estany  <carles@pina.cat>
> >
> > 	* menu/normal.c (run_menu): Add Home and End keys in grub-menu.
> 
> 
> This looks fine to me at first sight.  Do others have problems with
> this?  Otherwise it can be committed.

Why don't we use PgUp / PgDn instead?  That's more intuitive.

-- 
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."



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

* Re: [PATCH] Home-End keys in menu
  2008-08-13 10:50         ` Robert Millan
@ 2008-08-13 11:06           ` Marco Gerards
  2008-08-13 11:38           ` Javier Martín
  1 sibling, 0 replies; 12+ messages in thread
From: Marco Gerards @ 2008-08-13 11:06 UTC (permalink / raw)
  To: The development of GRUB 2

Robert Millan <rmh@aybabtu.com> writes:

> On Wed, Aug 13, 2008 at 12:15:37PM +0200, Marco Gerards wrote:
>> Hi,
>> 
>> Carles Pina i Estany <carles@pina.cat> writes:
>> 
>> [...]
>> 
>> > 2008-08-06  Carles Pina i Estany  <carles@pina.cat>
>> >
>> > 	* menu/normal.c (run_menu): Add Home and End keys in grub-menu.
>> 
>> 
>> This looks fine to me at first sight.  Do others have problems with
>> this?  Otherwise it can be committed.
>
> Why don't we use PgUp / PgDn instead?  That's more intuitive.

Or both?

--
Marco




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

* Re: [PATCH] Home-End keys in menu
  2008-08-13 10:50         ` Robert Millan
  2008-08-13 11:06           ` Marco Gerards
@ 2008-08-13 11:38           ` Javier Martín
  2008-08-13 11:44             ` Robert Millan
  1 sibling, 1 reply; 12+ messages in thread
From: Javier Martín @ 2008-08-13 11:38 UTC (permalink / raw)
  To: The development of GRUB 2

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

El mié, 13-08-2008 a las 12:50 +0200, Robert Millan escribió:
> On Wed, Aug 13, 2008 at 12:15:37PM +0200, Marco Gerards wrote:
> > Hi,
> > 
> > Carles Pina i Estany <carles@pina.cat> writes:
> > 
> > [...]
> > 
> > > 2008-08-06  Carles Pina i Estany  <carles@pina.cat>
> > >
> > > 	* menu/normal.c (run_menu): Add Home and End keys in grub-menu.
> > 
> > 
> > This looks fine to me at first sight.  Do others have problems with
> > this?  Otherwise it can be committed.
> 
> Why don't we use PgUp / PgDn instead?  That's more intuitive.
> 
Users with long menu lists may expect PgUp/PgDn to take them exactly
_one_ page up or down, not the whole list... I personally think that
Home/End are more intuitive for this particular UI interaction.

[-- Attachment #2: Esta parte del mensaje está firmada digitalmente --]
[-- Type: application/pgp-signature, Size: 827 bytes --]

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

* Re: [PATCH] Home-End keys in menu
  2008-08-13 11:38           ` Javier Martín
@ 2008-08-13 11:44             ` Robert Millan
  2008-08-13 15:31               ` Carles Pina i Estany
  0 siblings, 1 reply; 12+ messages in thread
From: Robert Millan @ 2008-08-13 11:44 UTC (permalink / raw)
  To: The development of GRUB 2

On Wed, Aug 13, 2008 at 01:38:27PM +0200, Javier Martín wrote:
> El mié, 13-08-2008 a las 12:50 +0200, Robert Millan escribió:
> > On Wed, Aug 13, 2008 at 12:15:37PM +0200, Marco Gerards wrote:
> > > Hi,
> > > 
> > > Carles Pina i Estany <carles@pina.cat> writes:
> > > 
> > > [...]
> > > 
> > > > 2008-08-06  Carles Pina i Estany  <carles@pina.cat>
> > > >
> > > > 	* menu/normal.c (run_menu): Add Home and End keys in grub-menu.
> > > 
> > > 
> > > This looks fine to me at first sight.  Do others have problems with
> > > this?  Otherwise it can be committed.
> > 
> > Why don't we use PgUp / PgDn instead?  That's more intuitive.
> > 
> Users with long menu lists may expect PgUp/PgDn to take them exactly
> _one_ page up or down, not the whole list... I personally think that
> Home/End are more intuitive for this particular UI interaction.

Uhm you're right.  Also, I notice this behaviour is consistent with `less'
(and since I love consistency, I must agree with you!)

I think the patch is fine in its current state.

-- 
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."



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

* Re: [PATCH] Home-End keys in menu
  2008-08-13 11:44             ` Robert Millan
@ 2008-08-13 15:31               ` Carles Pina i Estany
  0 siblings, 0 replies; 12+ messages in thread
From: Carles Pina i Estany @ 2008-08-13 15:31 UTC (permalink / raw)
  To: The development of GRUB 2


Hello,

I reply in this message a different things.

On Aug/13/2008, Robert Millan wrote:
> On Wed, Aug 13, 2008 at 01:38:27PM +0200, Javier Martín wrote:
> > El mié, 13-08-2008 a las 12:50 +0200, Robert Millan escribió:
> > > On Wed, Aug 13, 2008 at 12:15:37PM +0200, Marco Gerards wrote:
> > > > Hi,
> > > > 
> > > > Carles Pina i Estany <carles@pina.cat> writes:
> > > > 
> > > > [...]
> > > > 
> > > > > 2008-08-06  Carles Pina i Estany  <carles@pina.cat>
> > > > >
> > > > > 	* menu/normal.c (run_menu): Add Home and End keys in grub-menu.
> > > > 
> > > > 
> > > > This looks fine to me at first sight.  Do others have problems with
> > > > this?  Otherwise it can be committed.
> > > 
> > > Why don't we use PgUp / PgDn instead?  That's more intuitive.

I think that we should use Home/End and PgUp/PgDn for different things:

-Home/End: go straight to the first and last entry (this is done)

-PgUp/PgDn: it moves one page (I mean, selected item = selected item +
number of items)

I've implemented only Home/End key (by the moment, we can talk about
PgUp/PgDn later please :-) )

> > Users with long menu lists may expect PgUp/PgDn to take them exactly
> > _one_ page up or down, not the whole list... I personally think that
> > Home/End are more intuitive for this particular UI interaction.
> 
> Uhm you're right.  Also, I notice this behaviour is consistent with
> `less' (and since I love consistency, I must agree with you!)
> 
> I think the patch is fine in its current state.

me too ;-)

-- 
Carles Pina i Estany		GPG id: 0x17756391
	http://pinux.info



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

* Re: [PATCH] Home-End keys in menu
  2008-08-13 10:15       ` Marco Gerards
  2008-08-13 10:50         ` Robert Millan
@ 2008-08-16 18:51         ` Carles Pina i Estany
  2008-08-17 10:30           ` Felix Zielcke
  1 sibling, 1 reply; 12+ messages in thread
From: Carles Pina i Estany @ 2008-08-16 18:51 UTC (permalink / raw)
  To: The development of GRUB 2



Hi,

On Aug/13/2008, Marco Gerards wrote:
> Hi,
> 
> Carles Pina i Estany <carles@pina.cat> writes:
> 
> [...]
> 
> > 2008-08-06  Carles Pina i Estany  <carles@pina.cat>
> >
> > 	* menu/normal.c (run_menu): Add Home and End keys in grub-menu.
> 
> 
> This looks fine to me at first sight.  Do others have problems with
> this?  Otherwise it can be committed.

after this comment, Robert and Javier comments, feel free (somebody) to
commit it (I cannot commit, so I will not commmit :-) -just in case
somebody is expecting that I commit myself)

The message with the patch:

http://lists.gnu.org/archive/html/grub-devel/2008-08/msg00171.html

Thanks,

-- 
Carles Pina i Estany		GPG id: 0x17756391
	http://pinux.info



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

* Re: [PATCH] Home-End keys in menu
  2008-08-16 18:51         ` Carles Pina i Estany
@ 2008-08-17 10:30           ` Felix Zielcke
  0 siblings, 0 replies; 12+ messages in thread
From: Felix Zielcke @ 2008-08-17 10:30 UTC (permalink / raw)
  To: The development of GRUB 2

Commited.

Am Samstag, den 16.08.2008, 20:51 +0200 schrieb Carles Pina i Estany:
> 
> Hi,
> 
> On Aug/13/2008, Marco Gerards wrote:
> > Hi,
> > 
> > Carles Pina i Estany <carles@pina.cat> writes:
> > 
> > [...]
> > 
> > > 2008-08-06  Carles Pina i Estany  <carles@pina.cat>
> > >
> > > 	* menu/normal.c (run_menu): Add Home and End keys in grub-menu.
> > 
> > 
> > This looks fine to me at first sight.  Do others have problems with
> > this?  Otherwise it can be committed.
> 
> after this comment, Robert and Javier comments, feel free (somebody) to
> commit it (I cannot commit, so I will not commmit :-) -just in case
> somebody is expecting that I commit myself)
> 
> The message with the patch:
> 
> http://lists.gnu.org/archive/html/grub-devel/2008-08/msg00171.html
> 
> Thanks,
> 




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

end of thread, other threads:[~2008-08-17 10:31 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-21 18:07 [PATCH] Home-End keys in menu Carles Pina i Estany
2008-08-05 12:02 ` Carles Pina i Estany
2008-08-05 13:16   ` Marco Gerards
2008-08-06 18:31     ` Carles Pina i Estany
2008-08-13 10:15       ` Marco Gerards
2008-08-13 10:50         ` Robert Millan
2008-08-13 11:06           ` Marco Gerards
2008-08-13 11:38           ` Javier Martín
2008-08-13 11:44             ` Robert Millan
2008-08-13 15:31               ` Carles Pina i Estany
2008-08-16 18:51         ` Carles Pina i Estany
2008-08-17 10:30           ` Felix Zielcke

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.