all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: owner@emacsbugs.donarmstrong.com (Emacs bug Tracking System)
To: Stefan Monnier <monnier@iro.umontreal.ca>
Subject: bug#3394: marked as done (23.0.94; define-derived-mode keymap inheritance)
Date: Wed, 27 May 2009 02:55:06 +0000	[thread overview]
Message-ID: <handler.3394.D3394.124339246522027.ackdone@emacsbugs.donarmstrong.com> (raw)
In-Reply-To: 8F6FFAD957084AFF895F4896DA0D124C@us.oracle.com

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


Your message dated Tue, 26 May 2009 22:47:33 -0400
with message-id <jwvk543p8j1.fsf-monnier+emacsbugreports@gnu.org>
and subject line Re: bug#3394: 23.0.94; define-derived-mode keymap inheritance
has caused the Emacs bug report #3394,
regarding 23.0.94; define-derived-mode keymap inheritance
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@emacsbugs.donarmstrong.com
immediately.)


-- 
3394: http://emacsbugs.donarmstrong.com/cgi-bin/bugreport.cgi?bug=3394
Emacs Bug Tracking System
Contact owner@emacsbugs.donarmstrong.com with problems

[-- Attachment #2: Type: message/rfc822, Size: 4804 bytes --]

From: "Drew Adams" <drew.adams@oracle.com>
To: <emacs-pretest-bug@gnu.org>
Subject: 23.0.94; define-derived-mode keymap inheritance
Date: Tue, 26 May 2009 15:11:04 -0700
Message-ID: <8F6FFAD957084AFF895F4896DA0D124C@us.oracle.com>

Reporting this as a bug just in case it is. I don't know.
 
I have a file that requires `buff-menu.el', then does this, to
redefine `Buffer-menu-mode'.
 
(when (> emacs-major-version 22)
  (put 'Buffer-menu-mode 'mode-class 'special)
  (define-derived-mode Buffer-menu-mode special-mode "Buffer Menu"
    "..."
    (set (make-local-variable 'revert-buffer-function)
         'Buffer-menu-revert-function)
    (set (make-local-variable 'buffer-stale-function)
         #'(lambda (&optional noconfirm) 'fast))
    (setq truncate-lines t)
    (setq buffer-read-only t)))
 
That definition is actually identical to the original definition in
buff-menu.el. (In reality, my code adds a bit to the original
definition, but the problem occurs also with just the code above.
 
If I byte-compile the file in Emacs 22 or 23, which have
`define-derived-mode', then there is no problem. (Likewise, if
I load the *.el file instead of the *.elc.)

If I byte-compile in Emacs 20 (which does not have
`define-derived-mode'), then everything still works as usual,
except for one thing: The keymap for `special-mode' is apparently
not inherited. So for example, `q' and `g' have no key bindings
in the *Buffer List*.
 
By eyeballing it, the *.elc file would seem to be picking up the
`define-derived-mode' code as if it were a top-level function call,
which is what I would expect. I assume that the macro is defined when
the *.elc is loaded, so I would expect that `define-derived-mode'
would do its thing normally when the *.elc is loaded.
 
I know that there is no guarantee (quite the opposite) that code
byte-compiled in Emacs 20 will work in Emacs 23. But I wonder if there
might be a bug here anyway, wrt the keymap inheritance. If not, OK. In
that case, I'm just a bit curious what's happening - why everything
else seems to work fine, but the `special-mode' keymap doesn't seem to
be inherited.
 

 
In GNU Emacs 23.0.94.1 (i386-mingw-nt5.1.2600)
 of 2009-05-24 on SOFT-MJASON
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4)'
 



[-- Attachment #3: Type: message/rfc822, Size: 2076 bytes --]

From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Drew Adams <drew.adams@oracle.com>
Cc: 3394-done@emacsbugs.donarmstrong.com
Subject: Re: bug#3394: 23.0.94; define-derived-mode keymap inheritance
Date: Tue, 26 May 2009 22:47:33 -0400
Message-ID: <jwvk543p8j1.fsf-monnier+emacsbugreports@gnu.org>

> I know that there is no guarantee (quite the opposite) that code
> byte-compiled in Emacs 20 will work in Emacs 23. But I wonder if there
> might be a bug here anyway, wrt the keymap inheritance. If not, OK. In

Well, yes, there was a bug in Emacs-20's implementation of
define-derived-mode.  Not much we can do about it, I'm afraid.


        Stefan

      reply	other threads:[~2009-05-27  2:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <jwvk543p8j1.fsf-monnier+emacsbugreports@gnu.org>
2009-05-26 22:11 ` bug#3394: 23.0.94; define-derived-mode keymap inheritance Drew Adams
2009-05-27  2:55   ` Emacs bug Tracking System [this message]

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=handler.3394.D3394.124339246522027.ackdone@emacsbugs.donarmstrong.com \
    --to=owner@emacsbugs.donarmstrong.com \
    --cc=monnier@iro.umontreal.ca \
    /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.