Subject: Re: bug#64574: [PATCH] Support not jumping to bol in beginning-of-defun

From: Eli Zaretskii <[email-masked]>
Date: Sun, 23 Feb 2025 16:30:42 +0200

> From: Stefan Kangas <[email-masked]>
> Date: Sun, 23 Feb 2025 14:15:55 +0000
> Cc: [email-masked], [email-masked]
> 
> > 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.