From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Daniel_Mart=C3=ADn?= Newsgroups: gmane.emacs.devel Subject: Re: Don't move to eol in end-of-defun? Date: Sun, 31 Jul 2022 01:40:16 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39106"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (darwin) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jul 31 01:42:29 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 1oHw6H-000A0e-22 for ged-emacs-devel@m.gmane-mx.org; Sun, 31 Jul 2022 01:42:29 +0200 Original-Received: from localhost ([::1]:45472 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oHw6F-0005Nm-Iy for ged-emacs-devel@m.gmane-mx.org; Sat, 30 Jul 2022 19:42:27 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59630) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oHw4I-0004Sr-EP for emacs-devel@gnu.org; Sat, 30 Jul 2022 19:40:26 -0400 Original-Received: from sonic308-19.consmr.mail.ir2.yahoo.com ([77.238.178.147]:37271) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oHw4F-0003Wr-E8 for emacs-devel@gnu.org; Sat, 30 Jul 2022 19:40:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.es; s=s2048; t=1659224418; bh=IYjZS1xVR6ZqBKmvO0/k3ujdqowPHGwNvtCqZgdoF+8=; h=From:To:Subject:References:Date:In-Reply-To:From:Subject:Reply-To; b=fNg+qFuNkmPMfLP+plQZ5QHxvspEDKL6LLgwj+Iph6wQbY4KNAQQ3+4d8Dcnnid+ircPIDKp77yXY4RYGmNmYtzzl1KmLF4/52Qd/+4FswvFsql3MM86zNtnR4N/o4dF7lRcGtxw2PyJ3LqhmdreNs8cy+xEU86YFvt61BMvHI65exVHYNU1Ij3sy4N7kjeY6uE+2OJxy36mYKA7C1H1MV3nMyoN4CFUyZTmU2vzCWyY+X63D5KdXsEae54P5HSsbi6Ge+f12qi1RfDvf0eCJBPQJqvmjxN5GxpsR8jan9keDyFT/S+KFZhHtBADwcbtqQF/fggE5puU9vpg00+JfQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1659224418; bh=EVrkXgpqYfnttlre7asvKakGZjnHQg+o7+mXOXKaXWW=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=Zu/cTGHTI7K1EuwVxhOnZe/sBBUnDVLc/wTVWak7UUDOa7gGYjJxSkcBgxqkSLVP9B/ZSkDWoFBTTtzHnsQVJvNrj49KoDVfxRFKA0SeKIT6ttu3EgXwHuKUzoElUbkH9Mzf/SIbjfVt+zA6E1qGV08vLGOf7EORzi5KfPZ/Li3IPi1FyjGshiXv6ppgmkZL+lxdsEBs+JFOxBPkurV1DCcwG+aj1fO6E+MlHdTW9qtm7AGZfFMsI8Hq7opf/rtEb601XZXTuVtoA0ztYfmfSeGah997AUYRxUxKNi41jQF5ZDZVVfdQlfzQIuVLHKp9qPwV5vDxCUNRZLACLmSRIA== X-YMail-OSG: 5PUKnxMVM1maBhAuZ1Dp1FMgxhpkGZGk6bjMuqzedXckG2rTEGNZZJYy.YF3eli o1oNPXq.SuHKq_hd5JKIIKtipSubj9.e7sra0mudl6xKcHxb6tbcpXDgEAMQAgDJgOmzelhh9u8R 0jm8Z3bs5TVi6iE8q9WD1CpZ5Ubfn1TOXlc_88di_1Fjk7pFKcUqMdmhi1sdrZw6GTaAn46OXwBm fgHVBTNs7W1wWLQd0idid.MSpjjrMExXDqnJtLFdtr08i_Ny7GMEeniYO6JtBvxbh2rjzXApyiyB PSwR6gGf.NbU68CTRNoHJ3o.c57l_hBr.jvNFqAG6moLvmCRce5FFrdXyZGZJYy9bwloA8Mu9syb rjQ5abensrJAv9rp4TxPuzwVnmfhlW_oBenB0fb0pQqjS9lZcyt0ixS6PTS2feCwC9dmWfssX17T LezrmhPnI.rWq3M8tra_.cA19EjynttOZsM9r60.6lYEdehU3FJ1ckHm1Qxefxfuw2KiP8RuErwf 7t1RcmGrSd932y8BIHvqmGWhwfJFfl7Ua.af9rjkDEhEGhQl0nVksACO_iz7GdUiFjfGbLzOPYRL Ajj8N4HUc_fUJ26K_r2PcY.Ln5AmUFPWy1arACCaHKltXmtsu4I7yRbBkSvNf8MO2K9CFXy0iJeM QksnZOtjfHSYJ7XGACcFNZLfuTxTcOnD9to7iWiBK5usVTnddqB1CcFo2_RypizgPT.YL3redc3T rTyNU4xnkWbPcdWs_AcIk5R2sCEmHPIQZR9edknorIjpos9C.vbuW2Q_5R4hzUu1_l3.k0cjY4ou PpvLj9MpUXDlI5Y_u3rJcXpdHqUlwC6RJ8DhpKydOZ X-Sonic-MF: Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic308.consmr.mail.ir2.yahoo.com with HTTP; Sat, 30 Jul 2022 23:40:18 +0000 Original-Received: by hermes--canary-production-ir2-d447c45b6-gd9gk (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 7a59f402db44124b6e02347ff0863200; Sat, 30 Jul 2022 23:40:17 +0000 (UTC) In-Reply-To: (Filipp Gunbin's message of "Wed, 27 Jul 2022 15:40:57 +0300") X-Mailer: WebService/1.1.20447 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=77.238.178.147; envelope-from=mardani29@yahoo.es; helo=sonic308-19.consmr.mail.ir2.yahoo.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=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:292885 Archived-At: Filipp Gunbin writes: > In Java, it's a common style to have hanging parentheses: > > class C <1>{<2> > void foo() { > }<3> > }<4> > > If we're at position <1> and press C-M-e, then it's logical to move to > <4>, and that's what I implement in javaimp package, by defining my own > beginning-of-defun-function / end-of-defun-function. If I yank your sample program in a buffer in Java mode, with point at <1>, C-M-e goes to <4>, as expected. So I don=C2=B4t know why you need to implement your own end-of-defun-function in your package. > > OTOH, end-of-defun is documented to move to "next end of defun", and one > could say that moving from <1> to <3> is just that. The docstring is perhaps a bit confusing, but the Emacs manual and glossary defines what end-of-defun does in each major mode more precisely: It moves point to the end of the current defun. When the point is in between two defuns, the current defun is defined as the next defun that follows the point. So the expected navigation is <1> -> <4>, <2> -> <3>, which is how the included java-mode works. I'm not sure about the problem your solution is trying to fix. Perhaps I'm missing something.