unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#33237: 26.1, 7.3 emacs-mac: <fnum> list order in C-h b
@ 2018-11-02  4:47 Van L
  2019-07-10 13:36 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Van L @ 2018-11-02  4:47 UTC (permalink / raw)
  To: 33237

Hello,

This is a suggestion. 

The ordering on the f-number keys listed in the help buffer looks to me to be improvable.

The numsort as applied after f but before the greater-thang(>) will look nicer.

<f1>		help-command
<f10>		menu-bar-open
<f11>		toggle-frame-fullscreen
<f16>		clipboard-kill-ring-save
<f18>		clipboard-yank
<f2>		2C-command
<f20>		clipboard-kill-region
<f3>		kmacro-start-macro-or-insert-counter
<f4>		kmacro-end-or-call-macro






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

* bug#33237: 26.1, 7.3 emacs-mac: <fnum> list order in C-h b
  2018-11-02  4:47 bug#33237: 26.1, 7.3 emacs-mac: <fnum> list order in C-h b Van L
@ 2019-07-10 13:36 ` Lars Ingebrigtsen
  2019-07-10 15:02   ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Lars Ingebrigtsen @ 2019-07-10 13:36 UTC (permalink / raw)
  To: Van L; +Cc: 33237

Van L <van@scratch.space> writes:

> This is a suggestion. 
>
> The ordering on the f-number keys listed in the help buffer looks to
> me to be improvable.
>
> The numsort as applied after f but before the greater-thang(>) will look nicer.
>
> <f1>		help-command
> <f10>		menu-bar-open
> <f11>		toggle-frame-fullscreen
> <f16>		clipboard-kill-ring-save
> <f18>		clipboard-yank
> <f2>		2C-command
> <f20>		clipboard-kill-region
> <f3>		kmacro-start-macro-or-insert-counter
> <f4>		kmacro-end-or-call-macro

With the patch below, I get:

<f1>		help-command
<f2>		2C-command
<f3>		kmacro-start-macro-or-insert-counter
<f4>		kmacro-end-or-call-macro
<f10>		menu-bar-open
<f11>		toggle-frame-fullscreen
<f16>		clipboard-kill-ring-save
<f18>		clipboard-yank
<f20>		clipboard-kill-region

Looks nicer to me.  Does anybody object to this change?

diff --git a/src/keymap.c b/src/keymap.c
index 2ac3d33460..8c2c209e64 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -3098,8 +3098,8 @@ describe_map_compare (const void *aa, const void *bb)
   if (FIXNUMP (a->event) && !FIXNUMP (b->event))
     return -1;
   if (SYMBOLP (a->event) && SYMBOLP (b->event))
-    return (!NILP (Fstring_lessp (a->event, b->event)) ? -1
-	    : !NILP (Fstring_lessp (b->event, a->event)) ? 1
+    return (!NILP (Fstring_version_lessp (a->event, b->event)) ? -1
+	    : !NILP (Fstring_version_lessp (b->event, a->event)) ? 1
 	    : 0);
   return 0;
 }


-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

* bug#33237: 26.1, 7.3 emacs-mac: <fnum> list order in C-h b
  2019-07-10 13:36 ` Lars Ingebrigtsen
@ 2019-07-10 15:02   ` Eli Zaretskii
  2019-07-11 14:50     ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Eli Zaretskii @ 2019-07-10 15:02 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: van, 33237

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Date: Wed, 10 Jul 2019 15:36:53 +0200
> Cc: 33237@debbugs.gnu.org
> 
> <f1>		help-command
> <f2>		2C-command
> <f3>		kmacro-start-macro-or-insert-counter
> <f4>		kmacro-end-or-call-macro
> <f10>		menu-bar-open
> <f11>		toggle-frame-fullscreen
> <f16>		clipboard-kill-ring-save
> <f18>		clipboard-yank
> <f20>		clipboard-kill-region
> 
> Looks nicer to me.  Does anybody object to this change?
> 
> diff --git a/src/keymap.c b/src/keymap.c
> index 2ac3d33460..8c2c209e64 100644
> --- a/src/keymap.c
> +++ b/src/keymap.c
> @@ -3098,8 +3098,8 @@ describe_map_compare (const void *aa, const void *bb)
>    if (FIXNUMP (a->event) && !FIXNUMP (b->event))
>      return -1;
>    if (SYMBOLP (a->event) && SYMBOLP (b->event))
> -    return (!NILP (Fstring_lessp (a->event, b->event)) ? -1
> -	    : !NILP (Fstring_lessp (b->event, a->event)) ? 1
> +    return (!NILP (Fstring_version_lessp (a->event, b->event)) ? -1
> +	    : !NILP (Fstring_version_lessp (b->event, a->event)) ? 1
>  	    : 0);
>    return 0;
>  }

It sounds very strange to use string-version-lessp here, so I think
this must have a comment explaining why.

Btw, did you try string-collate-lessp instead?





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

* bug#33237: 26.1, 7.3 emacs-mac: <fnum> list order in C-h b
  2019-07-10 15:02   ` Eli Zaretskii
@ 2019-07-11 14:50     ` Lars Ingebrigtsen
  0 siblings, 0 replies; 4+ messages in thread
From: Lars Ingebrigtsen @ 2019-07-11 14:50 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: van, 33237

Eli Zaretskii <eliz@gnu.org> writes:

> It sounds very strange to use string-version-lessp here, so I think
> this must have a comment explaining why.

Yup.  I mean, it's a function with a strange name, but what it does is
nice (i.e., sort stretches of digits as a number).  In other
environments the function is often called something like "natural sort".

> Btw, did you try string-collate-lessp instead?

Yes, I tried it first, and it didn't do what I thought it would do:

(sort '("1" "2" "11") 'string-collate-lessp)
=> ("1" "11" "2")

Which isn't what we want...

I'll go ahead and apply the patch (with a comment) and we can see how we
like the result.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





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

end of thread, other threads:[~2019-07-11 14:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-02  4:47 bug#33237: 26.1, 7.3 emacs-mac: <fnum> list order in C-h b Van L
2019-07-10 13:36 ` Lars Ingebrigtsen
2019-07-10 15:02   ` Eli Zaretskii
2019-07-11 14:50     ` Lars Ingebrigtsen

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