all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stephen Berman <steve@ims.uni-stuttgart.de>
Subject: Re: keymap display inconsistency in help
Date: 01 May 2002 13:27:01 +0200	[thread overview]
Message-ID: <m3znzkyupm.fsf@steve.ims.uni-stuttgart.de> (raw)
In-Reply-To: <wefsn5efg02.fsf@ihs.com>

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

Kevin Rodgers <kevinr@ihs.com> writes:

> rms@gnu.org (Richard Stallman) writes:
[I <steve@ims.uni-stuttgart.de> had written:]
> >     If a major mode keymap is defined using (make-keymap), then in both
> >     the mode description and the function description of the mode the key
> >     bindings are displayed in ASCII order; but if the keymap is defined
> >     using (make-sparse-keymap), then the key bindings are displayed in
> >     reverse ASCII order.
> > 
> > Would you please send precise test cases?
> > You say "are displayed", but that is not clear:
> > displayed by what?  With precise test cases,
> > I would know the answer.

Whoops, my report was sent by mistake (I composed it offline and
pressed C-c C-c thinking that would send it to my Gnus queue for later
editing, but I didn't realize that M-x report-emacs-bug doesn't
interact with Gnus by default.  I assume it went into my sendmail
queue and was sent without my knowledge the next time I logged on.)
In fact I prepared a test case, which I append below.

> I think this is the same complaint discussed in the second part of
> this article:
> 
> From: kevinr@ihs.com (Kevin Rodgers)
> Subject: Re: C-x r refers to both rectangle and register...
> Date: Thu, 07 Mar 2002 17:03:32 -0700
> Message-ID: <3C87FFD4.97202D56@ihs.com>
> References: <m2it8kvtpb.fsf@dan.jacobson.tw>
> Newsgroups: gnu.emacs.bug

Hm, there you wrote:

> > I do C-x C-h and things are out of order, no matter what my LC_* env
> > variables are,
> [...]
> Because ctl-x-4-prefix is a sparse keymap, ordered from newest to oldest
> bindings.

I assume by "newest to oldest" you mean the same thing Stefan Monnier
wrote in the current thread:

> With a sparse keymap the order is determined by the order in which
> the bindings were added to the table.

But this is not the behavior I observed, as the appended test case
demonstrates -- that is, unless the bindings are added to the table in
reverse ASCII order, and not in the order they are defined in by the
mode-map defvar.  BTW, this also happens in Emacs 20.7.

--Steve Berman


[-- Attachment #2: test case for key bindings display --]
[-- Type: application/octet-stream, Size: 1584 bytes --]

Too see an example, start Emacs with -q --no-site-file and eval the
following four expressions:

(defun srb-test1-mode ()
  "Major mode to test display of key bindings.
\\{srb-test1-mode-map}"
  (use-local-map srb-test1-mode-map))

(defvar srb-test1-mode-map
  (let ((map (make-keymap)))
    (define-key map "a" 'srb-test-1)
    (define-key map "B" 'srb-test-2)
    (define-key map "C" 'srb-test-3)
    (define-key map "d" 'srb-test-4)
    map))

(defun srb-test2-mode ()
  "Major mode to test display of key bindings.
\\{srb-test2-mode-map}"
  (use-local-map srb-test2-mode-map))

(defvar srb-test2-mode-map
  (let ((map (make-sparse-keymap)))
    (define-key map "a" 'srb-test-1)
    (define-key map "B" 'srb-test-2)
    (define-key map "C" 'srb-test-3)
    (define-key map "d" 'srb-test-4)
    map))


Typing `M-h f srb-test1-mode' brings up this *Help* buffer:
___________________________________________________________
srb-test1-mode is a Lisp function.
(srb-test-mode)

Major mode to test display of key bindings.

key             binding
---             -------

B		srb-test-2
C		srb-test-3
a		srb-test-1
d		srb-test-4
___________________________________________________________


Typing `M-h f srb-test2-mode' brings up this *Help* buffer:
___________________________________________________________
srb-test2-mode is an interactive Lisp function.
(srb-test-mode)

Major mode to test display of key bindings.

key             binding
---             -------

d		srb-test-4
a		srb-test-1
C		srb-test-3
B		srb-test-2
___________________________________________________________

  reply	other threads:[~2002-05-01 11:27 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-26 17:09 keymap display inconsistency in help Stephen Berman
2002-04-29  5:06 ` Richard Stallman
2002-04-29 19:42   ` Kevin Rodgers
2002-05-01 11:27     ` Stephen Berman [this message]
2002-05-05  5:34       ` Richard Stallman
2002-05-06 22:03         ` Stephen Berman
2002-05-07 14:21           ` Miles Bader
2002-05-08 13:59             ` Richard Stallman
2002-04-29 13:43 ` Stefan Monnier

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

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

  git send-email \
    --in-reply-to=m3znzkyupm.fsf@steve.ims.uni-stuttgart.de \
    --to=steve@ims.uni-stuttgart.de \
    /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 external index

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

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.