ttn pushed a commit to branch master in repository elpa. commit 8b002449893614c2c991a26580bf5b84878b7142 Author: Thien-Thi Nguyen <t...@gnu.org> Date: Wed May 21 10:51:17 2014 +0200
[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/ascii-art-to-unicode.el | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/ascii-art-to-unicode/ascii-art-to-unicode.el b/packages/ascii-art-to-unicode/ascii-art-to-unicode.el index b39753f..733413c 100644 --- a/packages/ascii-art-to-unicode/ascii-art-to-unicode.el +++ b/packages/ascii-art-to-unicode/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))))