GNU bug report logs - #69943
30.0.50; Tabbing through widgets can signal beginning-of-buffer error

Previous Next

Package: emacs;

Reported by: Stephen Berman <stephen.berman <at> gmx.net>

Date: Fri, 22 Mar 2024 15:22:02 UTC

Severity: normal

Found in version 30.0.50

Done: Stephen Berman <stephen.berman <at> gmx.net>

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 69943 in the body.
You can then email your comments to 69943 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#69943; Package emacs. (Fri, 22 Mar 2024 15:22:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stephen Berman <stephen.berman <at> gmx.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 22 Mar 2024 15:22:02 GMT) Full text and rfc822 format available.

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

From: Stephen Berman <stephen.berman <at> gmx.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; Tabbing through widgets can signal beginning-of-buffer error
Date: Fri, 22 Mar 2024 15:45:16 +0100
[Message part 1 (text/plain, inline)]
0. emacs -Q

1. Evaluate the following sexp:

(let ((buf (get-buffer-create "*Widget Test*")))
  (switch-to-buffer buf)
  (dolist (el '("First" "Second" "Third"))
    (widget-create 'push-button el))
  (use-local-map widget-keymap)
  (widget-setup)
  (goto-char (point-min)))

Now the current buffer is *Widget Test* containing three push-button
widgets labeled "First", "Second", and "Third", and point is at the
start of the first widget, at BOB.

2. Hit the TAB key (bound to widget-forward) three times: this moves
point successively from "First" to "Second" to "Third" and then back to
"First" -- but on returning to the initial position after the third TAB,
a beginning-of-buffer error is also signaled.

3. Likewise, hitting S-TAB (bound to widget-backward) three times moves
backwards across the widgets, from "Third" to "Second" to "First", again
signaling a beginning-of-buffer error after the last S-TAB.

These beginning-of-buffer errors are due to widget-move (the workhorse
behind widget-forward and widget-backward) calling backward-char in a
loop without checking for BOB.  The attached patch fixes this.  The
patch also includes additions to widget-test-widget-move (from which
most of the above sexp was taken) that test moving to a widget at BOB.
(If the patch is acceptable, whoever commits it should use the correct
bug# before pushing it, or I can do that myself.)


2024-03-22  Stephen Berman  <stephen.berman <at> gmx.net>

Prevent error on tabbing to widget at beginning of buffer (bug#xxxxx)

* lisp/wid-edit.el (widget-move): Don't move backward when at
beginning of buffer, and keep point on widget's left side.

* test/lisp/wid-edit-tests.el (widget-test-widget-move): Adds
checks that moving to a widget at beginning of buffer does not
signal a beginning-of-buffer error.

[widget-move.diff (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]

In GNU Emacs 30.0.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version
 3.24.38, cairo version 1.18.0) of 2024-03-22 built on strobelfs2
Repository revision: c1530a2e4973005633ebe00d447f1f3aa1200301
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101009
System Description: Linux From Scratch r12.0-112

Configured using:
 'configure -C --with-xwidgets 'CFLAGS=-Og -g3'
 PKG_CONFIG_PATH=/opt/qt5/lib/pkgconfig'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER
PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS
TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM XWIDGETS GTK3 ZLIB


Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#69943; Package emacs. (Fri, 22 Mar 2024 15:38:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stephen Berman <stephen.berman <at> gmx.net>,
 Mauro Aranda <maurooaranda <at> gmail.com>
Cc: 69943 <at> debbugs.gnu.org
Subject: Re: bug#69943: 30.0.50;
 Tabbing through widgets can signal beginning-of-buffer error
Date: Fri, 22 Mar 2024 17:36:31 +0200
> Date: Fri, 22 Mar 2024 15:45:16 +0100
> From:  Stephen Berman via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
> 
> 0. emacs -Q
> 
> 1. Evaluate the following sexp:
> 
> (let ((buf (get-buffer-create "*Widget Test*")))
>   (switch-to-buffer buf)
>   (dolist (el '("First" "Second" "Third"))
>     (widget-create 'push-button el))
>   (use-local-map widget-keymap)
>   (widget-setup)
>   (goto-char (point-min)))
> 
> Now the current buffer is *Widget Test* containing three push-button
> widgets labeled "First", "Second", and "Third", and point is at the
> start of the first widget, at BOB.
> 
> 2. Hit the TAB key (bound to widget-forward) three times: this moves
> point successively from "First" to "Second" to "Third" and then back to
> "First" -- but on returning to the initial position after the third TAB,
> a beginning-of-buffer error is also signaled.
> 
> 3. Likewise, hitting S-TAB (bound to widget-backward) three times moves
> backwards across the widgets, from "Third" to "Second" to "First", again
> signaling a beginning-of-buffer error after the last S-TAB.
> 
> These beginning-of-buffer errors are due to widget-move (the workhorse
> behind widget-forward and widget-backward) calling backward-char in a
> loop without checking for BOB.  The attached patch fixes this.  The
> patch also includes additions to widget-test-widget-move (from which
> most of the above sexp was taken) that test moving to a widget at BOB.
> (If the patch is acceptable, whoever commits it should use the correct
> bug# before pushing it, or I can do that myself.)

Mauro, any comments to the proposed patch?

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#69943; Package emacs. (Mon, 01 Apr 2024 15:21:02 GMT) Full text and rfc822 format available.

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

From: Stephen Berman <stephen.berman <at> gmx.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 69943 <at> debbugs.gnu.org, Mauro Aranda <maurooaranda <at> gmail.com>
Subject: Re: bug#69943: 30.0.50; Tabbing through widgets can signal
 beginning-of-buffer error
Date: Mon, 01 Apr 2024 17:20:04 +0200
On Fri, 22 Mar 2024 17:36:31 +0200 Eli Zaretskii <eliz <at> gnu.org> wrote:

>> Date: Fri, 22 Mar 2024 15:45:16 +0100
>> From:  Stephen Berman via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>
>>
>> 0. emacs -Q
>>
>> 1. Evaluate the following sexp:
>>
>> (let ((buf (get-buffer-create "*Widget Test*")))
>>   (switch-to-buffer buf)
>>   (dolist (el '("First" "Second" "Third"))
>>     (widget-create 'push-button el))
>>   (use-local-map widget-keymap)
>>   (widget-setup)
>>   (goto-char (point-min)))
>>
>> Now the current buffer is *Widget Test* containing three push-button
>> widgets labeled "First", "Second", and "Third", and point is at the
>> start of the first widget, at BOB.
>>
>> 2. Hit the TAB key (bound to widget-forward) three times: this moves
>> point successively from "First" to "Second" to "Third" and then back to
>> "First" -- but on returning to the initial position after the third TAB,
>> a beginning-of-buffer error is also signaled.
>>
>> 3. Likewise, hitting S-TAB (bound to widget-backward) three times moves
>> backwards across the widgets, from "Third" to "Second" to "First", again
>> signaling a beginning-of-buffer error after the last S-TAB.
>>
>> These beginning-of-buffer errors are due to widget-move (the workhorse
>> behind widget-forward and widget-backward) calling backward-char in a
>> loop without checking for BOB.  The attached patch fixes this.  The
>> patch also includes additions to widget-test-widget-move (from which
>> most of the above sexp was taken) that test moving to a widget at BOB.
>> (If the patch is acceptable, whoever commits it should use the correct
>> bug# before pushing it, or I can do that myself.)
>
> Mauro, any comments to the proposed patch?

No comments yet, or did I miss them?  If not, any objections to
installing the patch?

Steve Berman




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#69943; Package emacs. (Mon, 01 Apr 2024 15:38:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stephen Berman <stephen.berman <at> gmx.net>
Cc: 69943 <at> debbugs.gnu.org, maurooaranda <at> gmail.com
Subject: Re: bug#69943: 30.0.50; Tabbing through widgets can signal
 beginning-of-buffer error
Date: Mon, 01 Apr 2024 18:37:35 +0300
> From: Stephen Berman <stephen.berman <at> gmx.net>
> Cc: Mauro Aranda <maurooaranda <at> gmail.com>,  69943 <at> debbugs.gnu.org
> Date: Mon, 01 Apr 2024 17:20:04 +0200
> 
> On Fri, 22 Mar 2024 17:36:31 +0200 Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
> > Mauro, any comments to the proposed patch?
> 
> No comments yet, or did I miss them?

You didn't.

> If not, any objections to installing the patch?

Let's give Mauro a few more days to chime in.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#69943; Package emacs. (Mon, 01 Apr 2024 15:42:01 GMT) Full text and rfc822 format available.

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

From: Stephen Berman <stephen.berman <at> gmx.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 69943 <at> debbugs.gnu.org, maurooaranda <at> gmail.com
Subject: Re: bug#69943: 30.0.50; Tabbing through widgets can signal
 beginning-of-buffer error
Date: Mon, 01 Apr 2024 17:41:36 +0200
On Mon, 01 Apr 2024 18:37:35 +0300 Eli Zaretskii <eliz <at> gnu.org> wrote:

>> From: Stephen Berman <stephen.berman <at> gmx.net>
>> Cc: Mauro Aranda <maurooaranda <at> gmail.com>,  69943 <at> debbugs.gnu.org
>> Date: Mon, 01 Apr 2024 17:20:04 +0200
>>
>> On Fri, 22 Mar 2024 17:36:31 +0200 Eli Zaretskii <eliz <at> gnu.org> wrote:
>>
>> > Mauro, any comments to the proposed patch?
>>
>> No comments yet, or did I miss them?
>
> You didn't.
>
>> If not, any objections to installing the patch?
>
> Let's give Mauro a few more days to chime in.

Sure.

Steve Berman




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#69943; Package emacs. (Sat, 06 Apr 2024 08:58:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Stephen Berman <stephen.berman <at> gmx.net>
Cc: 69943 <at> debbugs.gnu.org, maurooaranda <at> gmail.com
Subject: Re: bug#69943: 30.0.50; Tabbing through widgets can signal
 beginning-of-buffer error
Date: Sat, 06 Apr 2024 11:57:31 +0300
Ping! Mauro, can you please chime in?

> From: Stephen Berman <stephen.berman <at> gmx.net>
> Cc: maurooaranda <at> gmail.com,  69943 <at> debbugs.gnu.org
> Date: Mon, 01 Apr 2024 17:41:36 +0200
> 
> On Mon, 01 Apr 2024 18:37:35 +0300 Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
> >> From: Stephen Berman <stephen.berman <at> gmx.net>
> >> Cc: Mauro Aranda <maurooaranda <at> gmail.com>,  69943 <at> debbugs.gnu.org
> >> Date: Mon, 01 Apr 2024 17:20:04 +0200
> >>
> >> On Fri, 22 Mar 2024 17:36:31 +0200 Eli Zaretskii <eliz <at> gnu.org> wrote:
> >>
> >> > Mauro, any comments to the proposed patch?
> >>
> >> No comments yet, or did I miss them?
> >
> > You didn't.
> >
> >> If not, any objections to installing the patch?
> >
> > Let's give Mauro a few more days to chime in.
> 
> Sure.
> 
> Steve Berman
> 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#69943; Package emacs. (Thu, 18 Apr 2024 09:01:04 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: maurooaranda <at> gmail.com
Cc: 69943 <at> debbugs.gnu.org, stephen.berman <at> gmx.net
Subject: Re: bug#69943: 30.0.50;
 Tabbing through widgets can signal beginning-of-buffer error
Date: Thu, 18 Apr 2024 11:59:27 +0300
Ping! Ping!

> Cc: 69943 <at> debbugs.gnu.org, maurooaranda <at> gmail.com
> Date: Sat, 06 Apr 2024 11:57:31 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> 
> Ping! Mauro, can you please chime in?
> 
> > From: Stephen Berman <stephen.berman <at> gmx.net>
> > Cc: maurooaranda <at> gmail.com,  69943 <at> debbugs.gnu.org
> > Date: Mon, 01 Apr 2024 17:41:36 +0200
> > 
> > On Mon, 01 Apr 2024 18:37:35 +0300 Eli Zaretskii <eliz <at> gnu.org> wrote:
> > 
> > >> From: Stephen Berman <stephen.berman <at> gmx.net>
> > >> Cc: Mauro Aranda <maurooaranda <at> gmail.com>,  69943 <at> debbugs.gnu.org
> > >> Date: Mon, 01 Apr 2024 17:20:04 +0200
> > >>
> > >> On Fri, 22 Mar 2024 17:36:31 +0200 Eli Zaretskii <eliz <at> gnu.org> wrote:
> > >>
> > >> > Mauro, any comments to the proposed patch?
> > >>
> > >> No comments yet, or did I miss them?
> > >
> > > You didn't.
> > >
> > >> If not, any objections to installing the patch?
> > >
> > > Let's give Mauro a few more days to chime in.
> > 
> > Sure.
> > 
> > Steve Berman
> > 
> 
> 
> 
> 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#69943; Package emacs. (Thu, 18 Apr 2024 10:11:11 GMT) Full text and rfc822 format available.

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

From: Mauro Aranda <maurooaranda <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>, stephen.berman <at> gmx.net
Cc: 69943 <at> debbugs.gnu.org
Subject: Re: bug#69943: 30.0.50; Tabbing through widgets can signal
 beginning-of-buffer error
Date: Thu, 18 Apr 2024 07:09:56 -0300
Eli Zaretskii <eliz <at> gnu.org> writes:

> Ping! Ping!
>
>> Cc: 69943 <at> debbugs.gnu.org, maurooaranda <at> gmail.com
>> Date: Sat, 06 Apr 2024 11:57:31 +0300
>> From: Eli Zaretskii <eliz <at> gnu.org>
>>
>> Ping! Mauro, can you please chime in?
>>
>> > From: Stephen Berman <stephen.berman <at> gmx.net>
>> > Cc: maurooaranda <at> gmail.com,  69943 <at> debbugs.gnu.org
>> > Date: Mon, 01 Apr 2024 17:41:36 +0200
>> >
>> > On Mon, 01 Apr 2024 18:37:35 +0300 Eli Zaretskii <eliz <at> gnu.org> wrote:
>> >
>> > >> From: Stephen Berman <stephen.berman <at> gmx.net>
>> > >> Cc: Mauro Aranda <maurooaranda <at> gmail.com>,  69943 <at> debbugs.gnu.org
>> > >> Date: Mon, 01 Apr 2024 17:20:04 +0200
>> > >>
>> > >> On Fri, 22 Mar 2024 17:36:31 +0200 Eli Zaretskii <eliz <at> gnu.org> 
wrote:
>> > >>
>> > >> > Mauro, any comments to the proposed patch?
>> > >>

Looks good to me.  Sorry for the delay.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#69943; Package emacs. (Thu, 18 Apr 2024 11:38:13 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Mauro Aranda <maurooaranda <at> gmail.com>
Cc: 69943 <at> debbugs.gnu.org, stephen.berman <at> gmx.net
Subject: Re: bug#69943: 30.0.50; Tabbing through widgets can signal
 beginning-of-buffer error
Date: Thu, 18 Apr 2024 14:35:50 +0300
> Date: Thu, 18 Apr 2024 07:09:56 -0300
> Cc: 69943 <at> debbugs.gnu.org
> From: Mauro Aranda <maurooaranda <at> gmail.com>
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
>  > Ping! Ping!
>  >
>  >> Cc: 69943 <at> debbugs.gnu.org, maurooaranda <at> gmail.com
>  >> Date: Sat, 06 Apr 2024 11:57:31 +0300
>  >> From: Eli Zaretskii <eliz <at> gnu.org>
>  >>
>  >> Ping! Mauro, can you please chime in?
>  >>
>  >> > From: Stephen Berman <stephen.berman <at> gmx.net>
>  >> > Cc: maurooaranda <at> gmail.com,  69943 <at> debbugs.gnu.org
>  >> > Date: Mon, 01 Apr 2024 17:41:36 +0200
>  >> >
>  >> > On Mon, 01 Apr 2024 18:37:35 +0300 Eli Zaretskii <eliz <at> gnu.org> wrote:
>  >> >
>  >> > >> From: Stephen Berman <stephen.berman <at> gmx.net>
>  >> > >> Cc: Mauro Aranda <maurooaranda <at> gmail.com>,  69943 <at> debbugs.gnu.org
>  >> > >> Date: Mon, 01 Apr 2024 17:20:04 +0200
>  >> > >>
>  >> > >> On Fri, 22 Mar 2024 17:36:31 +0200 Eli Zaretskii <eliz <at> gnu.org> 
> wrote:
>  >> > >>
>  >> > >> > Mauro, any comments to the proposed patch?
>  >> > >>
> 
> Looks good to me.  Sorry for the delay.

Thanks.  Stephen, feel free to install and close the bug.




Reply sent to Stephen Berman <stephen.berman <at> gmx.net>:
You have taken responsibility. (Thu, 18 Apr 2024 13:38:07 GMT) Full text and rfc822 format available.

Notification sent to Stephen Berman <stephen.berman <at> gmx.net>:
bug acknowledged by developer. (Thu, 18 Apr 2024 13:38:08 GMT) Full text and rfc822 format available.

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

From: Stephen Berman <stephen.berman <at> gmx.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 69943-done <at> debbugs.gnu.org, Mauro Aranda <maurooaranda <at> gmail.com>
Subject: Re: bug#69943: 30.0.50; Tabbing through widgets can signal
 beginning-of-buffer error
Date: Thu, 18 Apr 2024 15:37:22 +0200
On Thu, 18 Apr 2024 14:35:50 +0300 Eli Zaretskii <eliz <at> gnu.org> wrote:

>> Date: Thu, 18 Apr 2024 07:09:56 -0300
>> Cc: 69943 <at> debbugs.gnu.org
>> From: Mauro Aranda <maurooaranda <at> gmail.com>
>> 
>> Eli Zaretskii <eliz <at> gnu.org> writes:
>> 
>>  > Ping! Ping!
>>  >
>>  >> Cc: 69943 <at> debbugs.gnu.org, maurooaranda <at> gmail.com
>>  >> Date: Sat, 06 Apr 2024 11:57:31 +0300
>>  >> From: Eli Zaretskii <eliz <at> gnu.org>
>>  >>
>>  >> Ping! Mauro, can you please chime in?
>>  >>
>>  >> > From: Stephen Berman <stephen.berman <at> gmx.net>
>>  >> > Cc: maurooaranda <at> gmail.com,  69943 <at> debbugs.gnu.org
>>  >> > Date: Mon, 01 Apr 2024 17:41:36 +0200
>>  >> >
>>  >> > On Mon, 01 Apr 2024 18:37:35 +0300 Eli Zaretskii <eliz <at> gnu.org> wrote:
>>  >> >
>>  >> > >> From: Stephen Berman <stephen.berman <at> gmx.net>
>>  >> > >> Cc: Mauro Aranda <maurooaranda <at> gmail.com>,  69943 <at> debbugs.gnu.org
>>  >> > >> Date: Mon, 01 Apr 2024 17:20:04 +0200
>>  >> > >>
>>  >> > >> On Fri, 22 Mar 2024 17:36:31 +0200 Eli Zaretskii <eliz <at> gnu.org> 
>> wrote:
>>  >> > >>
>>  >> > >> > Mauro, any comments to the proposed patch?
>>  >> > >>
>> 
>> Looks good to me.  Sorry for the delay.
>
> Thanks.  Stephen, feel free to install and close the bug.

Done as commit 94dec953179 to master and bug closed.  Thanks.

Steve Berman




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 17 May 2024 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 1 day ago.

Previous Next


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