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

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

[elpa] externals/ascii-art-to-unicode dfc56c7 18/42: [aa2u int] Add abst


From: Stefan Monnier
Subject: [elpa] externals/ascii-art-to-unicode dfc56c7 18/42: [aa2u int] Add abstraction: gsr
Date: Sun, 29 Nov 2020 18:57:06 -0500 (EST)

branch: externals/ascii-art-to-unicode
commit dfc56c74b03b6f2de740e3718b2362e56402f251
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>

    [aa2u int] Add abstraction: gsr
    
    * packages/ascii-art-to-unicode/ascii-art-to-unicode.el
    (aa2u-phase-1 gsr): New internal func.
---
 ascii-art-to-unicode.el | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/ascii-art-to-unicode.el b/ascii-art-to-unicode.el
index b39753f..733413c 100644
--- a/ascii-art-to-unicode.el
+++ b/ascii-art-to-unicode.el
@@ -131,14 +131,14 @@ Their values are STRINGIFIER and COMPONENTS, 
respectively."
                 'aa2u-components components)))
 
 (defun aa2u-phase-1 ()
-  (goto-char (point-min))
-  (let ((vert (aa2u-1c 'aa2u-ucs-bd-uniform-name 'VERTICAL)))
-    (while (search-forward "|" nil t)
-      (replace-match vert t t)))
-  (goto-char (point-min))
-  (let ((horz (aa2u-1c 'aa2u-ucs-bd-uniform-name 'HORIZONTAL)))
-    (while (search-forward "-" nil t)
-      (replace-match horz t t))))
+  (cl-flet
+      ((gsr (was name)
+            (goto-char (point-min))
+            (let ((now (aa2u-1c 'aa2u-ucs-bd-uniform-name name)))
+              (while (search-forward was nil t)
+                (replace-match now t t)))))
+    (gsr "|" 'VERTICAL)
+    (gsr "-" 'HORIZONTAL)))
 
 (defun aa2u-replacement (pos)
   (let ((cc (- pos (line-beginning-position))))



reply via email to

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