From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nicolas Richard Newsgroups: gmane.emacs.help Subject: Re: Stop modes from hijacking several global keys Date: Wed, 05 Nov 2014 10:41:30 +0100 Message-ID: <87lhnqougl.fsf@yahoo.fr> References: <87wq7a3zb0.fsf@thinkpad-t440p.tsdh.org> <87sihy3yuv.fsf@thinkpad-t440p.tsdh.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1415180598 26170 80.91.229.3 (5 Nov 2014 09:43:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Nov 2014 09:43:18 +0000 (UTC) To: help-gnu-emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Nov 05 10:43:11 2014 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 1Xlx7O-0005DG-V6 for geh-help-gnu-emacs@m.gmane.org; Wed, 05 Nov 2014 10:43:11 +0100 Original-Received: from localhost ([::1]:45359 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xlx7O-0004Zo-IR for geh-help-gnu-emacs@m.gmane.org; Wed, 05 Nov 2014 04:43:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54931) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xlx6L-0004SB-UO for help-gnu-emacs@gnu.org; Wed, 05 Nov 2014 04:42:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xlx62-000059-DP for help-gnu-emacs@gnu.org; Wed, 05 Nov 2014 04:42:05 -0500 Original-Received: from mxin.ulb.ac.be ([164.15.128.112]:49831) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xlx61-0008Ru-Th for help-gnu-emacs@gnu.org; Wed, 05 Nov 2014 04:41:46 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ai0KAIrvWVSkD4Xx/2dsb2JhbABchnG4MgEBAQEBAQabIgKBLAEBAQEBfYQDAQEDAX4LCAMhJQ8BBEkTiCsBDAm0VYwwAYcEDCCGN4JGiBqESwEEng6BMYYrim2ECYN5PC+CSwEBAQ Original-Received: from mathsrv4.ulb.ac.be (HELO localhost) ([164.15.133.241]) by smtp.ulb.ac.be with ESMTP; 05 Nov 2014 10:41:44 +0100 In-Reply-To: <87sihy3yuv.fsf@thinkpad-t440p.tsdh.org> (Tassilo Horn's message of "Wed, 05 Nov 2014 08:12:08 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.51 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 164.15.128.112 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:100759 Archived-At: Tassilo Horn writes: > Tassilo Horn writes: > >> Ideally, that magic would stop the mode from hijacking M- >> keys, and whatever it wants to bind to M- would automagically >> be bound to ` M-' instead. >> >> I think at least for major-modes I can use >> `after-change-major-mode-hook' in combination with a function checking >> (key-binding (kbd "M-")) and doing `local-set-key' if needed. Since minor modes have precedence of major modes, you could define your own minor mode with those keybindings. If you use John Wiegley's bind-key (or use-package), you already have such a minor mode : override-global-mode. bind-key* will add bindings to it. -- Nicolas Richard