From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#64574: [PATCH] Support not jumping to bol in beginning-of-defun Date: Tue, 11 Jul 2023 21:50:58 +0300 Message-ID: <83edle704t.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7497"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 64574@debbugs.gnu.org To: Spencer Baugh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 11 20:51:19 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1qJISE-0001iX-Ek for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 11 Jul 2023 20:51:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qJIS1-0001KD-G6; Tue, 11 Jul 2023 14:51:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qJIRz-0001Jw-BL for bug-gnu-emacs@gnu.org; Tue, 11 Jul 2023 14:51:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qJIRz-0001HN-3W for bug-gnu-emacs@gnu.org; Tue, 11 Jul 2023 14:51:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qJIRx-000283-QS for bug-gnu-emacs@gnu.org; Tue, 11 Jul 2023 14:51:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Jul 2023 18:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64574 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 64574-submit@debbugs.gnu.org id=B64574.16891014578168 (code B ref 64574); Tue, 11 Jul 2023 18:51:01 +0000 Original-Received: (at 64574) by debbugs.gnu.org; 11 Jul 2023 18:50:57 +0000 Original-Received: from localhost ([127.0.0.1]:51075 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qJIRs-00027g-T1 for submit@debbugs.gnu.org; Tue, 11 Jul 2023 14:50:57 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:44912) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qJIRq-00027P-H9 for 64574@debbugs.gnu.org; Tue, 11 Jul 2023 14:50:55 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qJIRk-0001D3-H9; Tue, 11 Jul 2023 14:50:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=PLZbhZGXyKkuPLycUtGVGUL0+JjwwyOMfaUYpStNLmM=; b=eKocryrfTmg8 S3NGcRfTgCUkxqzCF6cLjWF/xd0CMNm/rp2PvHNC91viljdFnolJF+819ExaDy/38LGTMVvQmmz6U rcpI/hdJGotLEk1Vj6D4+ls6bVu2ye1LZ5fQ9EqKiN4TvZz9dLGYqJUlm5YS80cJeXatVwt6YW2CO aAFV6/E4aWVrk9hsp5RydlI7r1jPNkLJmXpELpy8R0tTPHn7ksoDwEx6WfbtDH0rlu7pUKROTGX8t bs26JNR1EyYDEQb/VscSZvg3n8ZcCEg8RKlKQNblMb9Oa/x/QaeEvqqngAfanB2V+wGyz+ddO7gGQ p/NyM5zZfzqfDKKadza/Bg==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qJIRi-0008H3-Rz; Tue, 11 Jul 2023 14:50:47 -0400 In-Reply-To: (message from Spencer Baugh on Tue, 11 Jul 2023 14:15:35 -0400) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:264942 Archived-At: > From: Spencer Baugh > Date: Tue, 11 Jul 2023 14:15:35 -0400 > > As mentioned in the commit, this default behavior by > beginning-of-defun is undesirable in some languages and major modes. > I'm thinking of OCaml in particular here, but it's also arguably > unwanted in Python and C++ as well, where defs may be indented inside > class definitions. Let's let users and major modes make this decision > on a case-by-case basis. Such optional behavior is fine by me, but is there any evidence enough people will want it? Can you gather some feedback about that? > +(defvar beginning-of-defun-go-beginning-of-line t Why not defcustom? And I would use a shorter name, like beginning-of-defun-go-bol. > + "If non-nil, `beginning-of-defun' runs `beginning-of-line' at the end. This describes implementation, not the behavior. It also assumes everyone knows what exactly beginning-of-line does (think RTL text). > +By default, `beginning-of-defun' jumps to the beginning of the > +line with `beginning-of-line' after finding the start of the > +defun. I see no reason to tell in the doc string how exactly the function goes to BOL. It can even be a problem if at some future point we decide to change the implementation. > +For languages where defuns may be indented inside nested > +structures like classes or modules, this behavior may be > +undesirable. Major modes for such languages can set this > +variable to nil to avoid it.") Not sure we should leave this to major modes and not to the individual users. Thanks.