From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: William Stevenson Newsgroups: gmane.emacs.help Subject: Help with a big mode map Date: Fri, 10 May 2013 21:52:29 +0100 Message-ID: <87li7md0c2.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1368219190 11467 80.91.229.3 (10 May 2013 20:53:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 10 May 2013 20:53:10 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri May 10 22:53:10 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UauJQ-0000vw-5v for geh-help-gnu-emacs@m.gmane.org; Fri, 10 May 2013 22:53:08 +0200 Original-Received: from localhost ([::1]:39240 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UauJP-0003mF-Oq for geh-help-gnu-emacs@m.gmane.org; Fri, 10 May 2013 16:53:07 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:41412) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UauJ6-0003ig-Gr for help-gnu-emacs@gnu.org; Fri, 10 May 2013 16:52:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UauJ3-0008JU-Kq for help-gnu-emacs@gnu.org; Fri, 10 May 2013 16:52:48 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:50142) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UauJ3-0008JI-E0 for help-gnu-emacs@gnu.org; Fri, 10 May 2013 16:52:45 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UauIz-0000W5-UD for help-gnu-emacs@gnu.org; Fri, 10 May 2013 22:52:41 +0200 Original-Received: from cpc10-belf9-2-0-cust411.2-1.cable.virginmedia.com ([86.24.57.156]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 10 May 2013 22:52:41 +0200 Original-Received: from yhvh2000 by cpc10-belf9-2-0-cust411.2-1.cable.virginmedia.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 10 May 2013 22:52:41 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 36 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: cpc10-belf9-2-0-cust411.2-1.cable.virginmedia.com User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAIVBMVEVJRkm3XFcUDh23uGMo NR7Qv8RUNR5WDhkzDhjHKTh+JCrmrpKgAAACOklEQVQ4jV3TMYviQBQA4IFdr77hWCQpw8HaBkkv t7NgGyS9xy1jsLwiM6SUYIbtLJNqbTLr+5X33ptE3Xsgyvt8b948jSiKIhd3sfo2/F3Rh//gUQko f04gv1/TyWJf7Q4jbKT8CPArSRbg9ASFlLDlggOCd9srRCffKKQS4dkfjuUE8Xnu3FHr0uHbZ9L6 jxHmdWydATAY+zJ5Bgyeat7GxkAIje3aSu8ZfHvuoMPovcU8TuAYpLd7gAtByCfJEYSUMja2Naa+ g4VG+JEOO5ymxQo8wo4FGiHnMesOzmDAc0k9bLEVQdJeepA4L3wS7IdHOsNb596xjwTraoZ3eBQ0 bYCzhF2LsDgkLbwxGDuCNwitxbtrgn5nLEInYzzdOqBXxUBb6roTg6kBC8EQxJeuN5cOxwBPE9Pa LIKM6M7dCLxjGBxCJDsOAqA+1hiNkEfRBPR1b4yjEFgQQJ568DX2cY1zjRJ59xT1DDRcayqtKFYi Pz3lXBN5wBVU+goSAaeC3oygy0ap3wSp7E4oMIF2Sv0RGwLsBQEo/7Zu1IPYRDcYTDvBTCy5QkYQ 7syg1ghZmkn6QzDwCQhKZSLLixvACOtVIZbL5RWQxooXhAxhyesD3tNxgmICb8L+CF4LkdFzk8ac vsGMKoqUgPP4r3C8rGwEPjtQRQWrgmETIDTjoR4CYMkNbOmoU4ANw4BH0yGOOgUoUgIdfmyEly8w ENCT4prZDfCCWmP2eAfZPXAkXwGGEQ7JK6b+AQt2tYmejFLTAAAAAElFTkSuQmCC Cancel-Lock: sha1:77mPG6wAANNK8yBSYPpugeBBDFo= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:90623 Archived-At: I create a huge mode map for the game board, one for each intersection of lines, with entries like those below. Is there any way to collapse these entries or alternately register a more generic map? Prefix Command Prefix Command go-play-stone-mouse go-play-stone-mouse #+BEGIN_SRC elisp ;; Code lives at: https://github.com/yhvh/go-svg-mode (defvar gosvg-mode-map (let ((map (make-sparse-keymap))) (define-key map "g" 'go-board-update) (define-key map "k" 'gosvg-cleanup) (define-key map "p" 'go-play-stone) (define-key map "P" 'go-play-pass) (define-key map "m" 'go-genmove) (define-key map "l" 'go-level-set) (define-key map "b" 'go-boardsize-set) (define-key map "u" 'go-undo) (define-key map "e" 'go-estimate-score) (define-key map "F" 'go-final-score) (define-key map "L" 'go-load-sgf) (define-key map "S" 'go-save-sgf) ;; The svg image has a map of circles which show the pointer as ;; hand and fire an event like: . Here I bind all these ;; events to `go-play-stone-mouse'. This results in a great many ;; entries in the keymap. (dolist (pos go-position-map) (eval `(define-key map (vector (car pos) 'mouse-1) 'go-play-stone-mouse))) map) "Keymap for `gosvg-mode'") #+END_SRC