From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Daniele Nicolodi Newsgroups: gmane.emacs.devel Subject: Re: Major mode and implementation of expected editing facilities Date: Tue, 28 May 2019 13:52:35 -0600 Message-ID: References: <82832b3f-9e1c-cc3a-0a47-24e752e5b56c@grinta.net> <83blzn1epr.fsf@gnu.org> <0638d02d-967a-f0db-89f7-02f97bab87ba@grinta.net> <0C100B81-F296-44C7-8098-3111C709A8F1@gnu.org> <835zpu1ve2.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="20298"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue May 28 21:52:54 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hVi9W-0005Ay-7W for ged-emacs-devel@m.gmane.org; Tue, 28 May 2019 21:52:54 +0200 Original-Received: from localhost ([127.0.0.1]:41866 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVi9V-00027u-7l for ged-emacs-devel@m.gmane.org; Tue, 28 May 2019 15:52:53 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:45641) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVi9M-00026U-ON for emacs-devel@gnu.org; Tue, 28 May 2019 15:52:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hVi9K-0003N7-NB for emacs-devel@gnu.org; Tue, 28 May 2019 15:52:44 -0400 Original-Received: from zed.grinta.net ([109.74.203.128]:50252) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hVi9H-0003Kf-LM; Tue, 28 May 2019 15:52:40 -0400 Original-Received: from 688dnmac.campus.nist.gov (unknown [132.163.81.39]) (Authenticated sender: daniele) by zed.grinta.net (Postfix) with ESMTPSA id F3F7DFA5B7; Tue, 28 May 2019 19:52:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=grinta.net; s=mail; t=1559073158; bh=Jpq8ouvFrq6umWNadaUEPjD8WAQj58JablLljmTxals=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=A23ntt4MF1CxFLjsTYhfhfEudvNc7LVjgqDzA/0M1gh8+iNsPTDIB1GeoFETCRNR4 HN+km49xIf08tfD2BSDGj4LaUSQpDWONuoWjmoAdEylAPR8bbibBqgISEUa5kPRg6O twqhC4A9wKTTDDQ8JAJfK2TFaPIg546VmwTYYbJI= In-Reply-To: <835zpu1ve2.fsf@gnu.org> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 109.74.203.128 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:237124 Archived-At: On 28-05-2019 08:55, Eli Zaretskii wrote: >> From: Daniele Nicolodi >> Date: Mon, 27 May 2019 22:40:15 -0600 >> >> A major mode can also rebind the keys M-n, M-p and M-s. The bindings >> for M-n and M-p should normally be some kind of moving forward and >> backward, but this does not necessarily mean cursor motion. >> >> It is legitimate for a major mode to rebind a standard key sequence if >> it provides a command that does the same job in a way better suited to >> the text this mode is used for. For example, a major mode for editing >> a programming language might redefine C-M-a to move to the beginning >> of a function in a way that works better for that language. >> >> in "Major Mode Conventions", which describes exactly what I want to do, >> but does not give any pointer which key sequences it makes sense and it >> is most common to rebind. For example I don't fins mention of M-q >> (fill-paragraph) which was in my original example. >> >> Am I overlooking something? > > Given the above text, I'm not sure I understand what are you looking > for. Clearly, what specific keys a major mode can reasonably rebind > depends on the mode and what it does, right? IOW, it's your decision, > as someone who knows what the mode does, and which of its commands > could be usefully regarded as "generalizations" or "customizations" of > those in the related modes. The text above mention four example of keybindings that make sense to rebind in a mode: M-n, M-p, M-s, C-M-a. I'm surer this is not an exhaustive list and I am also sure there are cases in which rebinding the keys is not the right thing to do as in the case of M-q. >From your answer I understand that consistency in the "user interface" of major modes is not a desirable thing or that emacs hackers want to reserve for themselves the right to complain that new modes will not follow the emacs way. I understand that the elders like to have something to be grumpy about, but it does not invite new contributions. By the way, what is M-s supposed to do? It is not bind in the couple of modes I looked at. Cheers, Dan