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

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

[elpa] externals/greader 976d1b11d3 06/23: greader-dehyphenate rewritten


From: ELPA Syncer
Subject: [elpa] externals/greader 976d1b11d3 06/23: greader-dehyphenate rewritten.
Date: Wed, 26 Oct 2022 05:57:48 -0400 (EDT)

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

    greader-dehyphenate rewritten.
    
    wright now the function is enormously simpler.
---
 greader.el | 25 +++----------------------
 1 file changed, 3 insertions(+), 22 deletions(-)

diff --git a/greader.el b/greader.el
index 4baeb9c714..e259b8bbad 100644
--- a/greader.el
+++ b/greader.el
@@ -873,28 +873,9 @@ If prefix, it will be used to decrement  rate."
       t
     nil))
 
-(defun greader-dehyphenate (str)
-  "Dehyphenate STR.
-new lines can be either in unix stile, or ms, or macosX."
-  (let
-      ((new-sentence "")
-       (i 0)
-       )
-    (while (< i (length str))
-      (catch 'done
-       (if
-           (and
-            (member (string (aref str i)) greader-hyphenation-symbol)
-            (member (string (aref str (+ i 1))) greader-hyphenation-newlines))
-           (progn
-             (cl-incf i)
-             (while (or (member (string (aref str i)) 
greader-hyphenation-newlines)
-                        (member (string (aref str i)) greader-spaces))
-               (cl-incf i))
-             (throw 'done nil)))
-       (setq new-sentence (concat new-sentence (string (aref str i))))
-       (cl-incf i)))
-    new-sentence))
+(defun greader-dehyphenate (sentence)
+  (replace-regexp-in-string greader-hyphen-regex "" sentence))
+
 (defun greader-get-attributes ()
   "Print text properties associated with current char."
   (interactive)



reply via email to

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