aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Schwab2002-12-14 14:27:23 +0000
committerAndreas Schwab2002-12-14 14:27:23 +0000
commitea13a2b4d4cd201b87c3271a087f1e02205ad68b (patch)
treeb5065e3f4afc4e17c3b693c2dd2e8b0c96fa441e
parent2c568af5c7e671b76110f1269017d32b845b138b (diff)
downloademacs-ea13a2b4d4cd201b87c3271a087f1e02205ad68b.tar.gz
emacs-ea13a2b4d4cd201b87c3271a087f1e02205ad68b.zip
(widget-move): Don't loop infinitely when there is
no field or button.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/wid-edit.el12
2 files changed, 12 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ecc2ee2f3a0..50550908b9a 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12002-12-14 Andreas Schwab <schwab@suse.de>
2
3 * wid-edit.el (widget-move): Don't loop infinitely when there is
4 no field or button.
5
12002-12-13 Stefan Monnier <monnier@cs.yale.edu> 62002-12-13 Stefan Monnier <monnier@cs.yale.edu>
2 7
3 * uniquify.el (uniquify-rationalize-file-buffer-names, rename-buffer) 8 * uniquify.el (uniquify-rationalize-file-buffer-names, rename-buffer)
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index 4e97f9ad8c2..068b805d18b 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -1002,19 +1002,20 @@ This is much faster, but doesn't work reliably on Emacs 19.34.")
1002 "Move point to the ARG next field or button. 1002 "Move point to the ARG next field or button.
1003ARG may be negative to move backward." 1003ARG may be negative to move backward."
1004 (or (bobp) (> arg 0) (backward-char)) 1004 (or (bobp) (> arg 0) (backward-char))
1005 (let ((pos (point)) 1005 (let ((wrapped 0)
1006 (number arg) 1006 (number arg)
1007 (old (widget-tabable-at)) 1007 (old (widget-tabable-at))
1008 new) 1008 new)
1009 ;; Forward. 1009 ;; Forward.
1010 (while (> arg 0) 1010 (while (> arg 0)
1011 (cond ((eobp) 1011 (cond ((eobp)
1012 (goto-char (point-min))) 1012 (goto-char (point-min))
1013 (setq wrapped (1+ wrapped)))
1013 (widget-use-overlay-change 1014 (widget-use-overlay-change
1014 (goto-char (next-overlay-change (point)))) 1015 (goto-char (next-overlay-change (point))))
1015 (t 1016 (t
1016 (forward-char 1))) 1017 (forward-char 1)))
1017 (and (eq pos (point)) 1018 (and (= wrapped 2)
1018 (eq arg number) 1019 (eq arg number)
1019 (error "No buttons or fields found")) 1020 (error "No buttons or fields found"))
1020 (let ((new (widget-tabable-at))) 1021 (let ((new (widget-tabable-at)))
@@ -1025,12 +1026,13 @@ ARG may be negative to move backward."
1025 ;; Backward. 1026 ;; Backward.
1026 (while (< arg 0) 1027 (while (< arg 0)
1027 (cond ((bobp) 1028 (cond ((bobp)
1028 (goto-char (point-max))) 1029 (goto-char (point-max))
1030 (setq wrapped (1+ wrapped)))
1029 (widget-use-overlay-change 1031 (widget-use-overlay-change
1030 (goto-char (previous-overlay-change (point)))) 1032 (goto-char (previous-overlay-change (point))))
1031 (t 1033 (t
1032 (backward-char 1))) 1034 (backward-char 1)))
1033 (and (eq pos (point)) 1035 (and (= wrapped 2)
1034 (eq arg number) 1036 (eq arg number)
1035 (error "No buttons or fields found")) 1037 (error "No buttons or fields found"))
1036 (let ((new (widget-tabable-at))) 1038 (let ((new (widget-tabable-at)))