From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Lennart Borgman (gmail)" Newsgroups: gmane.emacs.devel Subject: Re: Longlines mode in menu Date: Wed, 18 Jun 2008 23:17:01 +0200 Message-ID: <48597B4D.4080103@gmail.com> References: <87wsl41lq0.fsf@stupidchicken.com> <87bq2666dd.fsf@stupidchicken.com> <516DD869-4D41-4EDD-B2A3-57787DF374D7@gmail.com> <4858B5B4.2070604@gmail.com> <66259172-038D-4367-BEAC-211FE9981637@gmail.com> <48593500.1030003@gmail.com> <48597529.1000400@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1213823854 19370 80.91.229.12 (18 Jun 2008 21:17:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 18 Jun 2008 21:17:34 +0000 (UTC) Cc: Emacs-Devel devel To: David Reitter Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 18 23:18:18 2008 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.50) id 1K952f-0006u3-0D for ged-emacs-devel@m.gmane.org; Wed, 18 Jun 2008 23:18:10 +0200 Original-Received: from localhost ([127.0.0.1]:45506 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K951p-0000ls-A8 for ged-emacs-devel@m.gmane.org; Wed, 18 Jun 2008 17:17:17 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1K951l-0000jy-4H for emacs-devel@gnu.org; Wed, 18 Jun 2008 17:17:13 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1K951j-0000ij-Ml for emacs-devel@gnu.org; Wed, 18 Jun 2008 17:17:12 -0400 Original-Received: from [199.232.76.173] (port=46871 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K951j-0000iJ-EU for emacs-devel@gnu.org; Wed, 18 Jun 2008 17:17:11 -0400 Original-Received: from ch-smtp02.sth.basefarm.net ([80.76.149.213]:33706) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1K951i-0008KC-Qn for emacs-devel@gnu.org; Wed, 18 Jun 2008 17:17:11 -0400 Original-Received: from c83-254-145-59.bredband.comhem.se ([83.254.145.59]:64613 helo=[127.0.0.1]) by ch-smtp02.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1K951e-0003Ve-6r; Wed, 18 Jun 2008 23:17:06 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 In-Reply-To: X-Antivirus: avast! (VPS 080617-0, 2008-06-17), Outbound message X-Antivirus-Status: Clean X-Originating-IP: 83.254.145.59 X-Scan-Result: No virus found in message 1K951e-0003Ve-6r. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1K951e-0003Ve-6r ce6da6084693f5622b626839196e4798 X-detected-kernel: by monty-python.gnu.org: Linux 2.6? (barebone, rare!) 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:99419 Archived-At: David Reitter wrote: > On 18 Jun 2008, at 21:50, Lennart Borgman (gmail) wrote: >> Could you show me exactly how and what you bind. I want to test and I >> had some trouble with bindings like this >> >> (define-key map [down] 'osxkeys-visual-line-down-in-buffers) > > > I'm binding this: > > (define-key map '[(up)] 'visual-line-up) > (define-key map '[(down)] 'visual-line-down) Thanks. > I'm actually binding this in my mode's "low priority keymap" so that > other minor modes can override. > I use the code below. > > That said, it should work from the normal minor mode keymap as well. > > - D > > > (defun aquamacs-install-low-priority-global-key-map (keymap &optional > target) > "Install keys from keymap keymap into the target (or global) map." > (let ((target (or target (current-global-map))) > (overwritten (make-sparse-keymap))) > (map-keymap > (lambda (key command) > (let ((old (lookup-key target `[,key]))) > (if (keymapp command) ; key is a prefix key > (if (keymapp old) > ;; recurse > (setq old (aquamacs-install-low-priority-global-key-map > command old))) > (define-key target `[,key] command)) > ;; also save "nil" entries for unassigned keys > (define-key overwritten `[,key] old))) > keymap) > overwritten)) Couldn't you just use a minor mode and put it last in minor-mode-map-alist? AFAICS new modes are entered first in that list by default.