GNU bug report logs - #22560
forward-word etc should be interactive-only

Previous Next

Package: emacs;

Reported by: Glenn Morris <rgm <at> gnu.org>

Date: Thu, 4 Feb 2016 21:03:01 UTC

Severity: normal

Found in version 25.0.90

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 22560 in the body.
You can then email your comments to 22560 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#22560; Package emacs. (Thu, 04 Feb 2016 21:03:01 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: submit <at> debbugs.gnu.org
Subject: forward-word etc should be interactive-only
Date: Thu, 04 Feb 2016 16:02:10 -0500
Package: emacs
Version: 25.0.90

The new implementation of subword-mode means that forward-word etc need
to be marked as interactive-only, all existing uses of such functions
need to be reviewed, and the issue needs to be mentioned in NEWS.

See bug#17558, where this was all pointed out.




Added indication that bug 22560 blocks19759 Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 04 Feb 2016 21:05:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22560; Package emacs. (Thu, 04 Feb 2016 21:16:02 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Glenn Morris <rgm <at> gnu.org>, 22560 <at> debbugs.gnu.org
Subject: RE: bug#22560: forward-word etc should be interactive-only
Date: Thu, 4 Feb 2016 13:15:17 -0800 (PST)
> The new implementation of subword-mode means that forward-word etc need
> to be marked as interactive-only, all existing uses of such functions
> need to be reviewed, and the issue needs to be mentioned in NEWS.
> 
> See bug#17558, where this was all pointed out.

Commands such as `forward-word' are explicitly counted on by
thingatpt.el and 3rd-party libraries to be used non-interactively.
The thingatpt code moves forward and backward over things using
`forward-*' and `backward-*' commands noninteractively.

Why would/should/must we consider such a command to be
"interactive-only"?

I see this in Emacs 25 NEWS:

** New properties that can be specified with `declare':
*** (interactive-only INSTEAD), says to use INSTEAD for non-interactive use.

Presumably this means that if you declare `forward-word' as
`interactive-only' then you will at the same time provide an
alternative that replaces it for noninteractive use.

If you do that, you will break 3rd-party code (I assume that you
will update the thingatpt.el code to use the new replacement).

Why not instead create a new _command_ to replace the _interactive_
use?  That likely breaks no code, except for key bindings, which
are quickly discovered by users and updated.

Why would limiting function `forward-ANYTHING' to interactive
use be TRT?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22560; Package emacs. (Fri, 05 Feb 2016 07:13:02 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 22560 <at> debbugs.gnu.org
Subject: Re: bug#22560: forward-word etc should be interactive-only
Date: Fri, 05 Feb 2016 18:10:27 +1100
Glenn Morris <rgm <at> gnu.org> writes:

> The new implementation of subword-mode means that forward-word etc need
> to be marked as interactive-only, all existing uses of such functions
> need to be reviewed, and the issue needs to be mentioned in NEWS.

Or perhaps the interactive forward-word (etc) commands should be renamed
to something new, and the old versions of forward-word (etc) should be
restored so that no code that uses these functions to parse stuff will
unbreak...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22560; Package emacs. (Fri, 05 Feb 2016 15:48:01 GMT) Full text and rfc822 format available.

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

From: Drew Adams <drew.adams <at> oracle.com>
To: Lars Ingebrigtsen <larsi <at> gnus.org>, Glenn Morris <rgm <at> gnu.org>
Cc: 22560 <at> debbugs.gnu.org
Subject: RE: bug#22560: forward-word etc should be interactive-only
Date: Fri, 5 Feb 2016 07:47:11 -0800 (PST)
> > The new implementation of subword-mode means that forward-word etc need
> > to be marked as interactive-only, all existing uses of such functions
> > need to be reviewed, and the issue needs to be mentioned in NEWS.
> 
> Or perhaps the interactive forward-word (etc) commands should be renamed
> to something new, and the old versions of forward-word (etc) should be
> restored so that no code that uses these functions to parse stuff will
> unbreak...

Yes.  That was my suggestion as well.  I, and I am sure others, have
a fair amount of code that uses `forward-word' (as well as other
`forward-*' functions).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22560; Package emacs. (Fri, 05 Feb 2016 16:42:02 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 22560 <at> debbugs.gnu.org
Subject: Re: bug#22560: forward-word etc should be interactive-only
Date: Fri, 05 Feb 2016 11:41:26 -0500
Lars Ingebrigtsen wrote:

> Or perhaps the interactive forward-word (etc) commands should be renamed
> to something new, and the old versions of forward-word (etc) should be
> restored so that no code that uses these functions to parse stuff will
> unbreak...

This too was mentioned in bug#17558, where Danial was against it.

This leaves Someone (TM) needing to do all the associated cleanup work.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22560; Package emacs. (Fri, 05 Feb 2016 16:45:01 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: 22560 <at> debbugs.gnu.org
Subject: Re: bug#22560: forward-word etc should be interactive-only
Date: Fri, 05 Feb 2016 11:44:05 -0500
Glenn Morris wrote:

> This too was mentioned in bug#17558, where Danial was against it.

(Sorry for the typo, I meant to say Daniel of course.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22560; Package emacs. (Fri, 05 Feb 2016 19:39:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 22560 <at> debbugs.gnu.org, larsi <at> gnus.org
Subject: Re: bug#22560: forward-word etc should be interactive-only
Date: Fri, 05 Feb 2016 21:38:18 +0200
> From: Glenn Morris <rgm <at> gnu.org>
> Date: Fri, 05 Feb 2016 11:41:26 -0500
> Cc: 22560 <at> debbugs.gnu.org
> 
> Lars Ingebrigtsen wrote:
> 
> > Or perhaps the interactive forward-word (etc) commands should be renamed
> > to something new, and the old versions of forward-word (etc) should be
> > restored so that no code that uses these functions to parse stuff will
> > unbreak...
> 
> This too was mentioned in bug#17558, where Danial was against it.

I'm also against it.  It would render the whole feature useless, and
we might as well rip it out then

> This leaves Someone (TM) needing to do all the associated cleanup work.

Guess who that Someone (TM) is.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22560; Package emacs. (Fri, 05 Feb 2016 20:18:02 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 22560 <at> debbugs.gnu.org, larsi <at> gnus.org
Subject: Re: bug#22560: forward-word etc should be interactive-only
Date: Fri, 05 Feb 2016 15:16:56 -0500
I don't want to get involved, but purely as a data point:
C-n runs next-line, which does all kinds of fancy stuff and is marked
for interactive-use only, and forward-line is for use in Lisp programs.
But 'twas ever thus, AFAIK.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22560; Package emacs. (Fri, 05 Feb 2016 22:01:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 22560 <at> debbugs.gnu.org, larsi <at> gnus.org
Subject: Re: bug#22560: forward-word etc should be interactive-only
Date: Sat, 06 Feb 2016 00:00:00 +0200
> From: Glenn Morris <rgm <at> gnu.org>
> Cc: larsi <at> gnus.org,  22560 <at> debbugs.gnu.org
> Date: Fri, 05 Feb 2016 15:16:56 -0500
> 
> 
> I don't want to get involved, but purely as a data point:
> C-n runs next-line, which does all kinds of fancy stuff and is marked
> for interactive-use only, and forward-line is for use in Lisp programs.
> But 'twas ever thus, AFAIK.

I don't think forward-word should be interactive-use only.




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Fri, 05 Feb 2016 22:16:02 GMT) Full text and rfc822 format available.

Notification sent to Glenn Morris <rgm <at> gnu.org>:
bug acknowledged by developer. (Fri, 05 Feb 2016 22:16:02 GMT) Full text and rfc822 format available.

Message #34 received at 22560-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 22560-done <at> debbugs.gnu.org
Subject: Re: bug#22560: forward-word etc should be interactive-only
Date: Sat, 06 Feb 2016 00:15:15 +0200
> From: Glenn Morris <rgm <at> gnu.org>
> Date: Thu, 04 Feb 2016 16:02:10 -0500
> 
> The new implementation of subword-mode means that forward-word etc need
> to be marked as interactive-only, all existing uses of such functions
> need to be reviewed, and the issue needs to be mentioned in NEWS.

The documentation is now fixed, including NEWS.  There are 2 new
functions, forward-word-strictly and backward-word-strictly, that move
by words using only the syntax table and disregarding
find-word-boundary-function-table.  I've reviewed all the users of
forward-word and backward-word, and made those of them which IMO
should not heed to the likes of subword-mode (there were quite a few)
use these new functions.

I didn't mark forward-word and backward-word interactive-only, as I
don't think this is needed, or even TRT, since the sub-word feature
explicitly wants to be honored in many word-related commands.

I therefore consider this bug "done".

As an aside, I don't understand how could we admit such pervasive
changes into our codebase without proper documentation and without
carefully considering its non-trivial implications.

I also think that the implementation of sub-word mode, which uses
find-word-boundary-function-table, is a kludge, and shouldn't have
been accepted in its present form.  find-word-boundary-function-table
is a char-table, which should have made it crystal clear that
(ab)using it to have the same function called for _any_ character is
against the spirit of char-tables.  This char-table was introduced for
script-specific word motion.  Patches to fix this aspect of sub-word
mode will be very welcome (on master).

But all this is a ship that sailed long ago, sadly, so all we can do
is lick our wounds and hope not to make such mistakes in the future.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22560; Package emacs. (Mon, 08 Feb 2016 18:13:03 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 22560 <at> debbugs.gnu.org
Subject: Re: bug#22560: forward-word etc should be interactive-only
Date: Mon, 08 Feb 2016 12:48:23 -0500
Thank you.
I think the doc of forward-word and backward-word should mention this
issue and xref to the -strictly versions. I also think an explicit
"by `find-word-boundary-function-table' (as used by e.g. `subword-mode')"
would be helpful.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#22560; Package emacs. (Wed, 10 Feb 2016 18:33:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: 22560 <at> debbugs.gnu.org
Subject: Re: bug#22560: forward-word etc should be interactive-only
Date: Wed, 10 Feb 2016 20:32:26 +0200
> From: Glenn Morris <rgm <at> gnu.org>
> Cc: 22560 <at> debbugs.gnu.org
> Date: Mon, 08 Feb 2016 12:48:23 -0500
> 
> 
> Thank you.

You are welcome.

> I think the doc of forward-word and backward-word should mention this
> issue and xref to the -strictly versions. I also think an explicit
> "by `find-word-boundary-function-table' (as used by e.g. `subword-mode')"
> would be helpful.

Done.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 10 Mar 2016 12:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 183 days ago.

Previous Next


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