From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Stephen J. Turnbull" Newsgroups: gmane.emacs.devel Subject: Re: substitute-key-definition vs. define-key MAP [remap ...] Date: Sat, 24 Jul 2010 23:25:52 +0900 Message-ID: <87tynpvtvz.fsf@uwakimon.sk.tsukuba.ac.jp> References: <871vb517a6.fsf@mithlond.arda> <87aapiyhzo.fsf@uwakimon.sk.tsukuba.ac.jp> <87y6d1we4j.fsf@uwakimon.sk.tsukuba.ac.jp> <87aaphusuz.fsf@catnip.gol.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1279981518 17611 80.91.229.12 (24 Jul 2010 14:25:18 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 24 Jul 2010 14:25:18 +0000 (UTC) Cc: Teemu Likonen , Stefan Monnier , emacs-devel@gnu.org To: Miles Bader Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 24 16:25:16 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ocff9-0002Uw-M8 for ged-emacs-devel@m.gmane.org; Sat, 24 Jul 2010 16:25:15 +0200 Original-Received: from localhost ([127.0.0.1]:52138 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ocff9-0002lR-4W for ged-emacs-devel@m.gmane.org; Sat, 24 Jul 2010 10:25:15 -0400 Original-Received: from [140.186.70.92] (port=50076 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ocff3-0002lL-IC for emacs-devel@gnu.org; Sat, 24 Jul 2010 10:25:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Ocff1-0002l3-R7 for emacs-devel@gnu.org; Sat, 24 Jul 2010 10:25:09 -0400 Original-Received: from mtps01.sk.tsukuba.ac.jp ([130.158.97.223]:60307) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Ocff1-0002kB-HZ; Sat, 24 Jul 2010 10:25:07 -0400 Original-Received: from uwakimon.sk.tsukuba.ac.jp (uwakimon.sk.tsukuba.ac.jp [130.158.99.156]) by mtps01.sk.tsukuba.ac.jp (Postfix) with ESMTP id 93FD11535A8; Sat, 24 Jul 2010 23:25:04 +0900 (JST) Original-Received: by uwakimon.sk.tsukuba.ac.jp (Postfix, from userid 1000) id E63291A26DF; Sat, 24 Jul 2010 23:25:52 +0900 (JST) In-Reply-To: <87aaphusuz.fsf@catnip.gol.com> X-Mailer: VM 8.0.12-devo-585 under 21.5 (beta29) "garbanzo" ed3b274cc037 XEmacs Lucid (x86_64-unknown-linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:127746 Archived-At: Miles Bader writes: > "Stephen J. Turnbull" writes: > > > And it's _extremely_ handy for some uses... e.g., one of my favorite > > > tricks is little minor-modes that bind [remap self-insert-command]... > > > > It's a handy hack, I'm sure. I think there are better ways to achieve > > the same end, that's all. > > For instance? Solutions as adding hooks/functions for to allow > mode-specific semantics for standard commands > (e.g. `fill-paragraph-function') are better for those cases, I think, > but they have far higher cost (they must be added by the emacs > developer), and are not really so nice for minor modes -- IOW, it > doesn't really achieve the same thing. Use of defun is not restricted to emacs developers (and you will often need to use it with [remap] anyway). For handy hacks, I really don't see what's so horrible about (define-minor-mode caps-lock-mode "Only useful with a Happy Hacker keyboard." :lighter "CapsLock") (defadvice self-insert-command (before caps-lock-mode activate) "Make self-insert-command respect caps-lock-mode." (when caps-lock-mode (set last-command-key (upcase last-command-key)))) and I certainly don't think that concealing a limited advice capability in the keymap lookup process is any better than advice itself.