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

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

[elpa] 02/03: [aa2u] Make ‘aa2u’ r egion-aware.


From: Thien-Thi Nguyen
Subject: [elpa] 02/03: [aa2u] Make ‘aa2u’ r egion-aware.
Date: Thu, 03 Apr 2014 10:21:38 +0000

ttn pushed a commit to branch master
in repository elpa.

commit e6dd1e29c574ea8353e35eb0b34477cf21c43423
Author: Thien-Thi Nguyen <address@hidden>
Date:   Thu Apr 3 12:22:42 2014 +0200

    [aa2u] Make ‘aa2u’ region-aware.
    
    * packages/ascii-art-to-unicode/ascii-art-to-unicode.el (aa2u):
    Take args BEG and END; use "r" in ‘interactive’ spec;
    don't bother w/ internal func ‘do-it!’.
---
 .../ascii-art-to-unicode/ascii-art-to-unicode.el   |   24 ++++++++-----------
 1 files changed, 10 insertions(+), 14 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 6c691a7..9442750 100644
--- a/packages/ascii-art-to-unicode/ascii-art-to-unicode.el
+++ b/packages/ascii-art-to-unicode/ascii-art-to-unicode.el
@@ -228,7 +228,7 @@ Their values are STRINGIFIER and COMPONENTS, respectively."
 ;;; command
 
 ;;;###autoload
-(defun aa2u ()
+(defun aa2u (beg end)
   "Convert simple ASCII art line drawings to Unicode.
 Specifically, perform the following replacements:
 
@@ -254,20 +254,16 @@ More precisely, hyphen and vertical bar are substituted 
unconditionally,
 first, and plus is substituted with a character depending on its north,
 south, east and west neighbors.
 
-This command operates on either the active region, as per
-`use-region-p', or the accessible portion otherwise."
-  (interactive)
+This command operates on either the active region,
+or the accessible portion otherwise."
+  (interactive "r")
   (save-excursion
-    (cl-flet
-        ((do-it! () (aa2u-phase-1) (aa2u-phase-2) (aa2u-phase-3)))
-      (if (use-region-p)
-          (let ((beg (region-beginning))
-                (end (region-end)))
-            (save-restriction
-              (widen)
-              (narrow-to-region beg end)
-              (do-it!)))
-        (do-it!)))))
+    (save-restriction
+      (widen)
+      (narrow-to-region beg end)
+      (aa2u-phase-1)
+      (aa2u-phase-2)
+      (aa2u-phase-3))))
 
 ;;;---------------------------------------------------------------------------
 ;;; that's it



reply via email to

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