diff options
author | Andrea Corallo <akrl@sdf.org> | 2020-04-06 18:06:29 +0100 |
---|---|---|
committer | Andrea Corallo <akrl@sdf.org> | 2020-04-06 18:06:29 +0100 |
commit | 4abb8c822ce02cf33712bd2699c5b77a5db49e31 (patch) | |
tree | 7520e3cae0f9a958ae223161034ebee6b5aa9e63 /lisp/emacs-lisp/re-builder.el | |
parent | 32a079aef290fdc8913c1ce4e8910e63e6ff6dcc (diff) | |
parent | 3dc2f50e5bf9f58aee23fd6c61c02fadc240a377 (diff) | |
download | emacs-4abb8c822ce02cf33712bd2699c5b77a5db49e31.tar.gz emacs-4abb8c822ce02cf33712bd2699c5b77a5db49e31.tar.bz2 emacs-4abb8c822ce02cf33712bd2699c5b77a5db49e31.zip |
Merge remote-tracking branch 'savannah/master' into HEAD
Diffstat (limited to 'lisp/emacs-lisp/re-builder.el')
-rw-r--r-- | lisp/emacs-lisp/re-builder.el | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/lisp/emacs-lisp/re-builder.el b/lisp/emacs-lisp/re-builder.el index 580e91483db..0e1618e010a 100644 --- a/lisp/emacs-lisp/re-builder.el +++ b/lisp/emacs-lisp/re-builder.el @@ -767,22 +767,21 @@ If SUBEXP is non-nil mark only the corresponding sub-expressions." (reb-mark-non-matching-parenthesis)) nil))) -(defsubst reb-while (limit counter where) - (let ((count (symbol-value counter))) - (if (= count limit) - (progn - (message "Reached (while limit=%s, where=%s)" limit where) - nil) - (set counter (1+ count))))) +(defsubst reb-while (limit current where) + (if (< current limit) + (1+ current) + (message "Reached (while limit=%s, where=%s)" limit where) + nil)) (defun reb-mark-non-matching-parenthesis (bound) ;; We have a small string, check the whole of it, but wait until ;; everything else is fontified. (when (>= bound (point-max)) - (let (left-pars + (let ((n-reb 0) + left-pars faces-here) (goto-char (point-min)) - (while (and (reb-while 100 'n-reb "mark-par") + (while (and (setq n-reb (reb-while 100 n-reb "mark-par")) (not (eobp))) (skip-chars-forward "^()") (unless (eobp) |