GNU bug report logs - #64574
[PATCH] Support not jumping to bol in beginning-of-defun

Previous Next

Package: emacs;

Reported by: Spencer Baugh <sbaugh <at> janestreet.com>

Date: Tue, 11 Jul 2023 18:16:02 UTC

Severity: wishlist

Tags: moreinfo, patch

Full log


Message #36 received at 64574 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: sbaugh <at> janestreet.com, 64574 <at> debbugs.gnu.org
Subject: Re: bug#64574: [PATCH] Support not jumping to bol in
 beginning-of-defun
Date: Sun, 23 Feb 2025 16:30:42 +0200
> From: Stefan Kangas <stefankangas <at> gmail.com>
> Date: Sun, 23 Feb 2025 14:15:55 +0000
> Cc: sbaugh <at> janestreet.com, 64574 <at> debbugs.gnu.org
> 
> > The default behavior is unchanged.  As for when users change the
> > default, the only difference is that beginning-of-defun will end not
> > necessarily at column zero, but at some other column in the same line,
> > where the function's declaration begins.  I don't see how this could
> > break things, but maybe I'm missing something?  Can you point to
> > places where we assume pointy is at column zero after calling
> > beginning-of-defun?
> 
> I can't point to any specific such places no, but grepping for
> `beginning-of-defun` yields a concerning number of hits, especially in
> progmodes.  Note that the assumption that it always goes to column zero
> has been documented since forever.  Who knows how this is used in the wild.
> 
> IOW, yes, the behavior is optional, but my concern is that when users
> set it, modes will start breaking.

I hope the users who Spencer say like it tested that in at least some
situations?

> I still think it could be useful, but perhaps it should be a defvar
> and under the control of major modes?  OTOH, then we have minor
> modes, but maybe it's used less frequently there?

Is this major-mode specific?

> If someone could look into this more and run some experiments, perhaps
> we can convince ourselves that this is fine after all, but to me this
> currently feels a bit risky.

I suggested to make it a user option because Spencer indicated users
liked that behavior.  User preferences should be expressed in user
options, not in just variables.

But if you feel uneasy, I won't object to making it a simple variable.




This bug report was last modified 116 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.