emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/greader 80c0de7c66 02/23: function `greader-sentence-ne


From: ELPA Syncer
Subject: [elpa] externals/greader 80c0de7c66 02/23: function `greader-sentence-needs-dehyphenation' rewritten
Date: Wed, 26 Oct 2022 05:57:47 -0400 (EDT)

branch: externals/greader
commit 80c0de7c662f2f94be9681dec0d8cc6dbbd3aa60
Author: Michelangelo Rodriguez <michelangelo.rodriguez@gmail.com>
Commit: Michelangelo Rodriguez <michelangelo.rodriguez@gmail.com>

    function `greader-sentence-needs-dehyphenation' rewritten
    
    function rewritten, now it uses regexp to verify if current sentence
    needs effectively dehyphenation.
---
 greader.el | 17 +++--------------
 1 file changed, 3 insertions(+), 14 deletions(-)

diff --git a/greader.el b/greader.el
index 43bebd458f..f64533fa37 100644
--- a/greader.el
+++ b/greader.el
@@ -882,20 +882,9 @@ If prefix, it will be used to decrement  rate."
   (greader-read))
 
 (defun greader-sentence-needs-dehyphenation (str)
-  "Return t if STR has lines iphenated."
-  (let
-      ((i 0)
-       (j 0))
-    (catch 'done
-      (while (< i (length str))
-       (if (and (member (string (aref str i)) greader-hyphenation-symbol)
-                (member (string (aref str (1+ i))) 
greader-hyphenation-newlines))
-           (progn
-             (setq j 1)
-             (throw 'done t)))
-       (cl-incf i))
-      (if (= j 0)
-         nil))))
+  (if (string-match "-[[:blank:]]+" str)
+      t
+    nil))
 
 (defun greader-dehyphenate (str)
   "Dehyphenate STR.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]