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: Sat, 15 Jan 2011 23:48:40 -0500 [thread overview]
Message-ID: <jwv1v4dv4ql.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <AANLkTimXLtgy6Be+GyuZp0kw=Gy83NWJbRRdrO3pD7f_@mail.gmail.com> (ken manheimer's message of "Sat, 15 Jan 2011 20:06:11 -0500")
> i agree that the code is painfully complicated. however, the fset
> actually is effective and necessary to impose the minor-mode keymap
> adjustments allout does.
I really can't understand who it could be effective. My reading of the
code tells me that function binding is never used.
> in fact, removing the fset leads to the same problems with the
> regular, defun'ed allout-mode that i have been seeing with the
> byte-compiled define-minor-mode defined allout mode.
That's what I would expect, since I think this fset is a no-op.
> the problem with switching to define-minor-mode is that
> define-minor-mode apparently associates the mode name with the keymap
> value, itself, on minor-mode-map-alist.
That's because that's what you told it:
:keymap <exp>
says to use the value of <exp> as the keymap, so ":keymap
allout-mode-map" says to use the value of the variable as the keymap.
If you want to use a symbol, then you need to quote it.
This said, you can modify a keymap after the fact: as long as you don't
do a (setq allout-mode-map <newmap>), you can modify allout-mode-map on
the fly and those changes will take effect immediately without having to
use an indirection through the allout-mode-map symbol.
Stefan
next prev parent reply other threads:[~2011-01-16 4:48 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
2011-01-16 1:06 ` ken manheimer
2011-01-16 4:48 ` Stefan Monnier [this message]
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=jwv1v4dv4ql.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.