From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Filipp Gunbin Newsgroups: gmane.emacs.devel Subject: Re: Don't move to eol in end-of-defun? Date: Thu, 04 Aug 2022 17:58:08 +0300 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33110"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin) Cc: emacs-devel@gnu.org To: Richard Stallman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Aug 04 16:59:15 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oJcJd-0008OB-Km for ged-emacs-devel@m.gmane-mx.org; Thu, 04 Aug 2022 16:59:15 +0200 Original-Received: from localhost ([::1]:34096 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oJcJc-0001yr-JY for ged-emacs-devel@m.gmane-mx.org; Thu, 04 Aug 2022 10:59:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48048) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJcIj-0000lL-79 for emacs-devel@gnu.org; Thu, 04 Aug 2022 10:58:17 -0400 Original-Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:48301) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oJcIh-0003Kr-DN; Thu, 04 Aug 2022 10:58:16 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 454413200921; Thu, 4 Aug 2022 10:58:12 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 04 Aug 2022 10:58:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.fm; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1659625091; x=1659711491; bh=CI+4WJVAyd HvDx4mea03o0Z0W7rj1QurnRELXoDPvdA=; b=HaUsffPvQimXID08PUqq/ro0ZE l2nKhHFBgGGywzTvUZk25rLckxa9adzCxVTxDxMZ4m+O6OLDAmZ7kputp0Jedpau ufp5NnRUSMaxmINnGAwZYq6XOzcchRZg/i9mdXHg/D5I1BrvIqGZ6n74SJLY8s9/ yL+oasCi2Ub1QJhgALP3vanhWYyowfEKLJlRXEkqTXuQvbovPOi+DAnPQKqrI0fF IY/ArAS2Nc39/C5xBq4zii63DnxyEAjs45Q+WS/Hd9+3gP9HBx/WxH53OtGAyIjs Wrl1ywjDrWMsSeQcDmkN3UoHl4GL8mRK8o5TznJPAz+gaW12i2SchSbEgHTw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1659625091; x=1659711491; bh=CI+4WJVAydHvDx4mea03o0Z0W7rj 1QurnRELXoDPvdA=; b=FnGqHmqsr31TBlZFn4jiWZdH6EYNO+xzlfuTmdoXPTQf xbYETfoubbzZfkH+kX3Hmae7r5cqMoA4jPIFVPlWbyVjZNFRDHAeJJZv7WOV/rVD mheYs7nmK5e9yI8ufyIZ/nkH2dSLt8x5rIX2G6UaBZqKfb09rbKCUZqWf5X0Ev4B EX0/Lm6UJSOTxrK8S0MoliuTtPshLLsPwz2gD4BK0IkE6czoiP8GXyxG9iBwKveI Kk91vS+r8QmJFSq2QXDWQURpmChM2gtry39KWsUPS+49UiwPmEAFMRuzjcYi0y9e ijv0hqOhOqoWbgnznoVlDVVLIRZOiak7HsSANnilEg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrvddvledgkeefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufgjfhgffffkgggtsehttd ertddtredtnecuhfhrohhmpefhihhlihhpphcuifhunhgsihhnuceofhhguhhnsghinhes fhgrshhtmhgrihhlrdhfmheqnecuggftrfgrthhtvghrnhepfffhjeevieeiiedutefghe ffleeiveeffeeftdekleehledufeeuueduheevieffnecuvehluhhsthgvrhfuihiivgep tdenucfrrghrrghmpehmrghilhhfrhhomhepfhhguhhnsghinhesfhgrshhtmhgrihhlrd hfmh X-ME-Proxy: Feedback-ID: id48c41f1:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 4 Aug 2022 10:58:10 -0400 (EDT) In-Reply-To: (Richard Stallman's message of "Thu, 04 Aug 2022 00:04:16 -0400") Mail-Followup-To: Richard Stallman , emacs-devel@gnu.org Received-SPF: pass client-ip=64.147.123.25; envelope-from=fgunbin@fastmail.fm; helo=wout2-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:293067 Archived-At: On 04/08/2022 00:04 -0400, Richard Stallman wrote: > [[[ To any NSA and FBI agents reading my email: please consider ]]] > [[[ whether defending the US Constitution against all enemies, ]]] > [[[ foreign or domestic, requires you to follow Snowden's example. ]]] > > > Yes, that will be the behavior. This post and example were about moving > > over the braces vs. moving into them, and <4> will really be on blank > > line between defuns. > > We may be partly miscommunicating. With other languages, such as > Lisp, C-M-e moves to the blank line after the defun from _anywhere_ > inside the defun. (Except in weird cases, such as this, > > (defun foo (a b) > x y z)) > > where the extra closeparen after the defun means the only valid place > to stop is before the extra closeparen.) > > You're planning to break that rule, right? > > I think that this rule behavior will be useful in other languages too; > maybe breaking it is not a good idea. No-no, I don't intend to break it. Returning to my example: class C <1>{<2> void foo() { }<3> }<4> <5> class D ... We're at point <1>. I'd like C-M-e to go to <5> (in my first email I said <4>, but that was my inaccuracy; it will be <5> except in weird cases like you showed). We have nested defuns here. When we're at <1>, we're "in class C's declaration", and C-M-e should move to after its end. But currently end-of-defun will first unconditionally move to eol (<2>), where the context is different: now we're "before foo()'s declaration", and C-M-e should move to <3>, which it does. The knowledge about nested contexts and their boundaries is provided by my mode, in beginning/end-of-defun-function. I just want to make movement to eol conditional, with default value meaning "like before", to not break anything. Filipp