[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] 232/352: Yksinkertaisempi silmukka: -read-strings ja -paint-strin
From: |
Stefan Monnier |
Subject: |
[elpa] 232/352: Yksinkertaisempi silmukka: -read-strings ja -paint-strings |
Date: |
Mon, 07 Jul 2014 14:04:28 +0000 |
monnier pushed a commit to branch master
in repository elpa.
commit 5b27989e49d0d6d1fdaed0f06483acdb5897f816
Author: Teemu Likonen <address@hidden>
Date: Sat Feb 5 11:20:35 2011 +0000
Yksinkertaisempi silmukka: -read-strings ja -paint-strings
---
wcheck-mode.el | 80 ++++++++++++++++++++++++-------------------------------
1 files changed, 35 insertions(+), 45 deletions(-)
diff --git a/wcheck-mode.el b/wcheck-mode.el
index 216dfb6..f9eaa07 100644
--- a/wcheck-mode.el
+++ b/wcheck-mode.el
@@ -1264,31 +1264,25 @@ areas, including invisible ones. Otherwise skip
invisible text."
(with-syntax-table (eval syntax)
(goto-char beg)
(save-match-data
- (catch 'infinite
- (while (re-search-forward regexp end t)
- (cond ((= (point) old-point)
- ;; Make sure we don't end up in an infinite
- ;; loop when the regexp always matches with
- ;; zero width in the current point position.
- (throw 'infinite t))
-
- ((and (not invisible)
- (invisible-p (match-beginning 1)))
- ;; This point is invisible. Let's jump forward
- ;; to next change of "invisible" property.
- (goto-char (next-single-char-property-change
- (match-beginning 1) 'invisible buffer
- end)))
-
- ((and (eval face-p)
- (or (equal regexp-discard "")
- (not (string-match
- regexp-discard
- (match-string-no-properties 1)))))
- ;; Add the match to the string list.
- (add-to-list
- 'strings (match-string-no-properties 1))))
- (setq old-point (point))))))
+ (while (and (re-search-forward regexp end t)
+ (> (point) old-point))
+ (cond ((and (not invisible)
+ (invisible-p (match-beginning 1)))
+ ;; This point is invisible. Let's jump forward
+ ;; to next change of "invisible" property.
+ (goto-char (next-single-char-property-change
+ (match-beginning 1) 'invisible buffer
+ end)))
+
+ ((and (eval face-p)
+ (or (equal regexp-discard "")
+ (not (string-match
+ regexp-discard
+ (match-string-no-properties 1)))))
+ ;; Add the match to the string list.
+ (add-to-list
+ 'strings (match-string-no-properties 1))))
+ (setq old-point (point)))))
strings))))))
@@ -1331,26 +1325,22 @@ text."
old-point 0)
(goto-char beg)
- (catch 'infinite
- (while (re-search-forward regexp end t)
- (cond ((= (point) old-point)
- ;; We didn't move forward so break the loop.
- ;; Otherwise we would loop endlessly.
- (throw 'infinite t))
- ((and (not invisible)
- (invisible-p (match-beginning 1)))
- ;; The point is invisible so jump forward to
- ;; the next change of "invisible" text
- ;; property.
- (goto-char (next-single-char-property-change
- (match-beginning 1) 'invisible buffer
- end)))
- ((eval face-p)
- ;; Make an overlay.
- (wcheck-make-overlay
- buffer ol-face ol-mouse-face ol-help-echo
ol-keymap
- (match-beginning 1) (match-end 1))))
- (setq old-point (point)))))))))))))
+ (while (and (re-search-forward regexp end t)
+ (> (point) old-point))
+ (cond ((and (not invisible)
+ (invisible-p (match-beginning 1)))
+ ;; The point is invisible so jump forward to
+ ;; the next change of "invisible" text
+ ;; property.
+ (goto-char (next-single-char-property-change
+ (match-beginning 1) 'invisible buffer
+ end)))
+ ((eval face-p)
+ ;; Make an overlay.
+ (wcheck-make-overlay
+ buffer ol-face ol-mouse-face ol-help-echo ol-keymap
+ (match-beginning 1) (match-end 1))))
+ (setq old-point (point))))))))))))
;;; Jump forward or backward
- [elpa] 220/352: Lisätään kuvaus muuttujaan wcheck-timer-paint-event-count-std, (continued)
- [elpa] 220/352: Lisätään kuvaus muuttujaan wcheck-timer-paint-event-count-std, Stefan Monnier, 2014/07/07
- [elpa] 219/352: Muutetaan wcheck-timer-idlen määrittelytyyppi: defconst -> defvar, Stefan Monnier, 2014/07/07
- [elpa] 221/352: Muutetaan mode-line-tieto: "W:" ja kielen kaksi ensimmäistä merkkiä, Stefan Monnier, 2014/07/07
- [elpa] 227/352: Käsitellään käyttäjän funktioissa tapahtuvat virheilmoitukset, Stefan Monnier, 2014/07/07
- [elpa] 222/352: Hiotaan virheilmoituksia, Stefan Monnier, 2014/07/07
- [elpa] 229/352: Muutetaan wcheck-mode-komennon kuvausta, Stefan Monnier, 2014/07/07
- [elpa] 216/352: Uusi ominaisuus: etsi seuraava/edellinen merkitty kohta, Stefan Monnier, 2014/07/07
- [elpa] 230/352: Muutetaan alun kommentissa olevaa kuvausta, Stefan Monnier, 2014/07/07
- [elpa] 224/352: Poistetaan jump-reqistä turha hyppysuuntatieto, Stefan Monnier, 2014/07/07
- [elpa] 223/352: Hiotaan oikolukuehdotusten valikkoa, Stefan Monnier, 2014/07/07
- [elpa] 232/352: Yksinkertaisempi silmukka: -read-strings ja -paint-strings,
Stefan Monnier <=
- [elpa] 234/352: Uusi funktio: wcheck-process-running-p, Stefan Monnier, 2014/07/07
- [elpa] 228/352: Monipuolisempi read-or-skip-faces, Stefan Monnier, 2014/07/07
- [elpa] 226/352: Poistetaan maininta vanhasta muuttujasta wcheck-read-or-skip-faces, Stefan Monnier, 2014/07/07
- [elpa] 225/352: Käsitellään hyppytoiminnossa myös puskurin alku ja loppu, Stefan Monnier, 2014/07/07
- [elpa] 231/352: Versio 2011.01.09, Stefan Monnier, 2014/07/07
- [elpa] 237/352: Makron wcheck-with-language-data muuttujille paremmat nimet, Stefan Monnier, 2014/07/07
- [elpa] 236/352: Lisätään makroihin sisennysasetukset: (declare (indent ...)), Stefan Monnier, 2014/07/07
- [elpa] 238/352: Poistetaan turha #' lambda-rakenteiden edestä, Stefan Monnier, 2014/07/07
- [elpa] 245/352: Correction in wcheck-language-data doc: "variable" -> "value", Stefan Monnier, 2014/07/07
- [elpa] 240/352: Mainostetaan funktiota wcheck-marked-text-at julkiseen käyttöön, Stefan Monnier, 2014/07/07