unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stephen Berman <stephen.berman@gmx.net>,
	Mauro Aranda <maurooaranda@gmail.com>
Cc: 69943@debbugs.gnu.org
Subject: bug#69943: 30.0.50; Tabbing through widgets can signal beginning-of-buffer error
Date: Fri, 22 Mar 2024 17:36:31 +0200	[thread overview]
Message-ID: <8634si1dog.fsf@gnu.org> (raw)
In-Reply-To: <87il1enx4z.fsf@rub.de> (bug-gnu-emacs@gnu.org)

> 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@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.





  reply	other threads:[~2024-03-22 15:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-22 14:45 bug#69943: 30.0.50; Tabbing through widgets can signal beginning-of-buffer error Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-22 15:36 ` Eli Zaretskii [this message]
2024-04-01 15:20   ` Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-01 15:37     ` Eli Zaretskii
2024-04-01 15:41       ` Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-06  8:57         ` Eli Zaretskii
2024-04-18  8:59           ` Eli Zaretskii
2024-04-18 10:09             ` Mauro Aranda
2024-04-18 11:35               ` Eli Zaretskii
2024-04-18 13:37                 ` Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8634si1dog.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=69943@debbugs.gnu.org \
    --cc=maurooaranda@gmail.com \
    --cc=stephen.berman@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).