From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Grant Rettke Newsgroups: gmane.emacs.help Subject: Re: Overriding major mode key bindings Date: Mon, 5 Sep 2016 09:15:56 -0500 Message-ID: References: <20160905000221.GA12566@mail.akwebsoft.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: blaine.gmane.org 1473085067 25051 195.159.176.226 (5 Sep 2016 14:17:47 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 5 Sep 2016 14:17:47 +0000 (UTC) To: Emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Sep 05 16:17:41 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bguiN-0005E3-KI for geh-help-gnu-emacs@m.gmane.org; Mon, 05 Sep 2016 16:17:35 +0200 Original-Received: from localhost ([::1]:54913 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bguiL-0003Ej-9B for geh-help-gnu-emacs@m.gmane.org; Mon, 05 Sep 2016 10:17:33 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35827) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgugq-0002iA-Dp for Help-gnu-emacs@gnu.org; Mon, 05 Sep 2016 10:16:01 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bgugn-00081C-TO for Help-gnu-emacs@gnu.org; Mon, 05 Sep 2016 10:15:59 -0400 Original-Received: from mail-it0-x232.google.com ([2607:f8b0:4001:c0b::232]:38880) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bgugn-00080w-PE for Help-gnu-emacs@gnu.org; Mon, 05 Sep 2016 10:15:57 -0400 Original-Received: by mail-it0-x232.google.com with SMTP id c198so148630833ith.1 for ; Mon, 05 Sep 2016 07:15:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to; bh=EpC2hmTAWCh6zPspZGmX+gj38V2LQNges0APkqOb9hk=; b=xt3UWmTpvAL4bwq4YvkS/vzQw8xV3MVm46FUWlPctV7IdDEXDj1f+LrtzQazfRFWQ/ vn8bR1DjlHOEfFwH7O22C1sHKA00KatmNqKfxLRI3T/fUkA9y5et9LnDB/5GwxccQMs9 sbuESNdo8GLcmmbBgpcUwB/QT0qUmc+wDuVUsLc4sCwjl8oayq3/1s5py0Mey2Cd0ztX Gil6SP3IBwlu4xUVekWIOShTERrPBuYjcTHueISOguVUir7jSYuaxbM5WBGwFNEPwaj2 egkp2uTns5zU8o4jIdqrkGt4fCcAeYVNHJyz/V/8YAIYY8X/byJ04alpzrxNADRqePXa QHoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=EpC2hmTAWCh6zPspZGmX+gj38V2LQNges0APkqOb9hk=; b=HbQ7m+ky7vCSzz+aVuy/pQ6+qfAu0bqs6/ZfaOLAVWtis/lah06sZMUxDdBKsDqe7r ml0OFosUBGSdb/zbTYpw4wBqULhIsnb2DLjz6F+YX1odBpHMh9HLKD1Rxn/08yDZwF+o ksiF47gAi7zIkdJZi3cX0p6cyKz7B4m/yv3M8PjK0RDFPX2CPyMVuhtSqU/ERd8wvbTc 2ppi8GlkauH0aDeWuqrk+84ApvUKjRQNjSjVdcfdZ3WxeB/8PIXwDW5X+/+FYdAwsD64 kBI3AJ8jUWYB5/TlofUYcWTp79vocBchRHzAOTlKs1FKJreyLmu/y2aBedm/jgXKmGHY UjuQ== X-Gm-Message-State: AE9vXwM6gU/9op3YmVl3n6vHQonUPxzBEdpVJS/MlOJPvzr8DmzOQrScXduC9gTwaDL8FMaupnyCza1YqeuU9A== X-Received: by 10.36.237.6 with SMTP id r6mr22297148ith.62.1473084956793; Mon, 05 Sep 2016 07:15:56 -0700 (PDT) Original-Received: by 10.79.90.69 with HTTP; Mon, 5 Sep 2016 07:15:56 -0700 (PDT) In-Reply-To: <20160905000221.GA12566@mail.akwebsoft.com> X-Google-Sender-Auth: zs1pYwCvzOmLLyST3a_QHdrYOsQ X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4001:c0b::232 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.help:111265 Archived-At: On Sun, Sep 4, 2016 at 7:02 PM, Tim Johnson wrote: > After some research, it looks like what I really should do is > to create my own minor mode and and bind the keys the I want to > "protect" to that minor mode. > > See > http://emacs.stackexchange.com/questions/352/how-to-override-major-mode-bindings/358#358 > > Am I on the right track? I am soliciting a second opinion. Yes because `global-set-key' bindings can easily get stomped on to your point. The caveat is that it is fine if you only use it for virtually never used keys. For example I use `f9' because it is a long-reach and no one every binds to it. Sounds like you are bindings keys that do get used often, and you aren't OK with that and that is exactly why you would use a minor mode. Happy hacking.