all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: ken manheimer <ken.manheimer@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: bizarre problem with minor mode defined using define-minor-mode
Date: Tue, 11 Jan 2011 16:42:58 -0500	[thread overview]
Message-ID: <jwvei8jktn8.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <AANLkTik31DQJhEEVXjVo7wuouhXCh_TxD1Wswg0gaW2=@mail.gmail.com> (ken manheimer's message of "Sat, 25 Dec 2010 19:31:42 -0500")

> i've tried tracking down the failed key substitutions, by
> wrapping define-key with some advice that noted when the key defines
> happened, and they do every time the mode is activated, whether or not it's
> via the byte-compiled version of the mode function (when defined
> by define-minor-mode).  my function which does the key
> substitutions (allout-setup-mode-map) uses fset to ensure that the mode map
> is properly globally established, so it's already kind of complicated.  i'm
> also wondering whether i'm just misunderstanding something about the way
> define-minor-mode is supposed to work.

I think the code is too complex for its own good, so I can't really
track down the problem.  But AFAICT, the `allout-mode-map' symbol is
never used as a keymap, so the (fset 'allout-mode-map allout-mode-map)
has no effect: all the rest of the code uses the allout-mode-map
*variable* (i.e. the value stored in the `symbol-value' part of the
allout-mode-map symbol).


        Stefan


PS: While I'm here, don't use `setq' at top-level.  Either put the right
initial value into `defvar', or if you want that value to be re-set when
rereading the file, use `defconst' instead of defvar, but don't use
`setq' at top-level.



  reply	other threads:[~2011-01-11 21:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AANLkTimx4fP1f9Cj3_3ErkWEqj7sxNgTXG_Yxz-zi0xV@mail.gmail.com>
     [not found] ` <AANLkTimf5w9-N=j7wLnb339xDD7PCGDf1f=H4EGoO1TJ@mail.gmail.com>
     [not found]   ` <AANLkTimiwTZA4UHpEPo83cFZK9r4VWkwesGcDo4GGVGu@mail.gmail.com>
2010-12-26  0:31     ` bizarre problem with minor mode defined using define-minor-mode ken manheimer
2011-01-11 21:42       ` Stefan Monnier [this message]
2011-01-16  1:06         ` ken manheimer
2011-01-16  4:48           ` Stefan Monnier
2011-01-16  6:15             ` ken manheimer
2011-01-16  6:46               ` Stefan Monnier
2011-01-16  8:55                 ` Andreas Schwab
2011-01-20 18:21                 ` ken manheimer

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=jwvei8jktn8.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=ken.manheimer@gmail.com \
    /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.