[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ascii-art-to-unicode 1e682b8 02/42: [aa2u] Make ‘aa2u’
From: |
Stefan Monnier |
Subject: |
[elpa] externals/ascii-art-to-unicode 1e682b8 02/42: [aa2u] Make ‘aa2u’ region-aware. |
Date: |
Sun, 29 Nov 2020 18:57:03 -0500 (EST) |
branch: externals/ascii-art-to-unicode
commit 1e682b83be84db87e0ff48e7ca59031e6cba567d
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>
[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.el | 24 ++++++++++--------------
1 file changed, 10 insertions(+), 14 deletions(-)
diff --git a/ascii-art-to-unicode.el b/ascii-art-to-unicode.el
index 6c691a7..9442750 100644
--- a/ascii-art-to-unicode.el
+++ b/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
- [elpa] branch externals/ascii-art-to-unicode created (now 46e24a6), Stefan Monnier, 2020/11/29
- [elpa] externals/ascii-art-to-unicode f319591 01/42: New package: ascii-art-to-unicode, Stefan Monnier, 2020/11/29
- [elpa] externals/ascii-art-to-unicode 1e682b8 02/42: [aa2u] Make ‘aa2u’ region-aware.,
Stefan Monnier <=
- [elpa] externals/ascii-art-to-unicode 42f07bc 04/42: [aa2u] Fix bug: Make ‘M-x aa2u’ operate on accessible portion., Stefan Monnier, 2020/11/29
- [elpa] externals/ascii-art-to-unicode fc130df 05/42: [aa2u] Release: 1.6, Stefan Monnier, 2020/11/29
- [elpa] externals/ascii-art-to-unicode 1a107c7 06/42: [aa2u maint] Extract NEWS and HACKING to separate files; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/ascii-art-to-unicode 80b9003 08/42: [aa2u int] Don't use ‘cl-labels’ when ‘cl-flet*’ will do., Stefan Monnier, 2020/11/29
- [elpa] externals/ascii-art-to-unicode 6b628eb 14/42: [aa2u] New command: aa2u-rectangle, Stefan Monnier, 2020/11/29
- [elpa] externals/ascii-art-to-unicode 45094de 11/42: [aa2u maint] Update HACKING; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/ascii-art-to-unicode 119855b 15/42: [aa2u] Release: 1.7, Stefan Monnier, 2020/11/29
- [elpa] externals/ascii-art-to-unicode dfc56c7 18/42: [aa2u int] Add abstraction: gsr, Stefan Monnier, 2020/11/29
- [elpa] externals/ascii-art-to-unicode c25476c 19/42: [aa2u] New command: aa2u-mark-as-text, Stefan Monnier, 2020/11/29
- [elpa] externals/ascii-art-to-unicode b9fcf21 21/42: [aa2u maint] Mention TAB infelicity in HACKING; nfc., Stefan Monnier, 2020/11/29