From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joe Brenner Newsgroups: gmane.emacs.devel Subject: Re: coding guidelines? (was Re: Key bindings proposal) Date: Sat, 31 Jul 2010 12:19:37 -0700 Message-ID: <201007311919.o6VJJbGT083196@kzsu.stanford.edu> References: <19534.1494.627000.357123@gargle.gargle.HOWL> <201007300204.o6U24Htf048494@kzsu.stanford.edu> <87ocdptivg.fsf@uwakimon.sk.tsukuba.ac.jp> NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1280603991 8968 80.91.229.12 (31 Jul 2010 19:19:51 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 31 Jul 2010 19:19:51 +0000 (UTC) Cc: Stefan Monnier , emacs-devel@gnu.org To: "Stephen J. Turnbull" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 31 21:19:50 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 1OfHb4-0007X3-1i for ged-emacs-devel@m.gmane.org; Sat, 31 Jul 2010 21:19:50 +0200 Original-Received: from localhost ([127.0.0.1]:60293 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OfHb3-00054i-7v for ged-emacs-devel@m.gmane.org; Sat, 31 Jul 2010 15:19:49 -0400 Original-Received: from [140.186.70.92] (port=49178 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OfHaw-00054Z-Lt for emacs-devel@gnu.org; Sat, 31 Jul 2010 15:19:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OfHav-0003R7-86 for emacs-devel@gnu.org; Sat, 31 Jul 2010 15:19:42 -0400 Original-Received: from smtp4.stanford.edu ([171.67.219.84]:38965 helo=smtp.stanford.edu) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OfHav-0003Qt-0O for emacs-devel@gnu.org; Sat, 31 Jul 2010 15:19:41 -0400 Original-Received: from smtp.stanford.edu (localhost.localdomain [127.0.0.1]) by localhost (Postfix) with SMTP id F1F401A5C95; Sat, 31 Jul 2010 12:19:38 -0700 (PDT) Original-Received: from kzsu.stanford.edu (KZSU.Stanford.EDU [171.66.118.90]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.stanford.edu (Postfix) with ESMTPS id DCA961A5C81; Sat, 31 Jul 2010 12:19:37 -0700 (PDT) Original-Received: from kzsu.stanford.edu (localhost.stanford.edu [127.0.0.1]) by kzsu.stanford.edu (8.14.4/8.14.4) with ESMTP id o6VJJbGT083196; Sat, 31 Jul 2010 12:19:37 -0700 (PDT) (envelope-from doom@kzsu.stanford.edu) In-reply-to: <87ocdptivg.fsf@uwakimon.sk.tsukuba.ac.jp> Comments: In-reply-to "Stephen J. Turnbull" message dated "Fri, 30 Jul 2010 18:32:35 +0900." X-Mailer: MH-E 8.2; nmh 1.2; GNU Emacs 24.0.50 X-Spam: Probability=8%, Report=' BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_2000_2999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, DATE_TZ_NA 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __MIME_TEXT_ONLY 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __URI_NO_PATH 0, __URI_NO_WWW 0' X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:128063 Archived-At: Stephen J. Turnbull wrote: > Joe Brenner writes: > > > I would welcome patches that try to make intentions more clear > > > (e.g. eliminate the massive hardcoding of the "C-c" prefix all over the > > > Rather than hardcoding "C-c", what are we supposed to do? > > Create a separate map and bind it to a single prefix key sequence. > Usually the prefix sequence should also be configurable. From > footnote.el: > > ;;;###autoload > (defvar footnote-prefix [(control ?c) ?!] > "*When not using message mode, the prefix to bind in `mode-specific-map'") > > ;;;###autoload > (defvar footnote-mode-map nil > "Keymap used for footnote minor mode.") > > ;; Set up our keys > ;;;###autoload > (unless footnote-mode-map > (setq footnote-mode-map (make-sparse-keymap)) > (define-key footnote-mode-map "a" 'Footnote-add-footnote) > (define-key footnote-mode-map "b" 'Footnote-back-to-message) > (define-key footnote-mode-map "c" 'Footnote-cycle-style) > (define-key footnote-mode-map "d" 'Footnote-delete-footnote) > (define-key footnote-mode-map "g" 'Footnote-goto-footnote) > (define-key footnote-mode-map "r" 'Footnote-renumber-footnotes) > (define-key footnote-mode-map "s" 'Footnote-set-style)) > > ;;;###autoload > (define-key global-map footnote-prefix footnote-mode-map) > > That's not quite verbatim; there's some additional weirdness about > footnote-minor-mode-map that I don't really understand. This is pretty good (and much better than the hacks I was trying to get a customizeable prefix key), but this puts the new bindings in the global keymap. I think what's going on in footnote.el is that they wanted the new bindings in it's own map which is associated with a new minor mode. That approach makes a little more sense to me (for my immediate problem, anyway), but I'm a little puzzled that the minor mode bindings don't go away when you shut off the minor mode. Do I need to do something in an after mode hook to cleanup?