[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ascii-art-to-unicode 6b628eb 14/42: [aa2u] New command:
From: |
Stefan Monnier |
Subject: |
[elpa] externals/ascii-art-to-unicode 6b628eb 14/42: [aa2u] New command: aa2u-rectangle |
Date: |
Sun, 29 Nov 2020 18:57:05 -0500 (EST) |
branch: externals/ascii-art-to-unicode
commit 6b628ebe3aac45e600eab61bf2509d0cdbf208ae
Author: Thien-Thi Nguyen <ttn@gnu.org>
Commit: Thien-Thi Nguyen <ttn@gnu.org>
[aa2u] New command: aa2u-rectangle
* packages/ascii-art-to-unicode/ascii-art-to-unicode.el (aa2u-rectangle):
New command.
---
NEWS | 1 +
ascii-art-to-unicode.el | 17 ++++++++++++++++-
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/NEWS b/NEWS
index ae86a66..3c1452e 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@ See the end for copying conditions.
- 1.7 | NOT YET RELEASED
- new var: ‘aa2u-uniform-weight’
+ - new command: ‘aa2u-rectangle’
- 1.6 | 2014-05-09
- fix regression for interactive invocation w/o active region
diff --git a/ascii-art-to-unicode.el b/ascii-art-to-unicode.el
index a4cdf6d..ea7ea86 100644
--- a/ascii-art-to-unicode.el
+++ b/ascii-art-to-unicode.el
@@ -22,6 +22,7 @@
;; The command `aa2u' converts simple ASCII art line drawings in
;; the {active,accessible} region of the current buffer to Unicode.
+;; Command `aa2u-rectangle' is like `aa2u', but works on rectangles.
;;
;; Example use case:
;; - M-x artist-mode RET
@@ -206,7 +207,7 @@ Their values are STRINGIFIER and COMPONENTS, respectively."
'aa2u-components nil)))
;;;---------------------------------------------------------------------------
-;;; command
+;;; commands
;;;###autoload
(defun aa2u (beg end &optional interactive)
@@ -257,6 +258,20 @@ or the accessible portion otherwise."
(aa2u-phase-2)
(aa2u-phase-3))))
+;;;###autoload
+(defun aa2u-rectangle (start end)
+ "Like `aa2u' on the region-rectangle.
+When called from a program the rectangle's corners
+are START (top left) and END (bottom right)."
+ (interactive "r")
+ (let* ((was (delete-extract-rectangle start end))
+ (now (with-temp-buffer
+ (insert-rectangle was)
+ (aa2u (point) (mark))
+ (extract-rectangle (point-min) (point-max)))))
+ (goto-char (min start end))
+ (insert-rectangle now)))
+
;;;---------------------------------------------------------------------------
;;; 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, 2020/11/29
- [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 <=
- [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
- [elpa] externals/ascii-art-to-unicode 01635f7 07/42: [aa2u int] Add "Tip Jar" URL in Commentary; nfc., Stefan Monnier, 2020/11/29
- [elpa] externals/ascii-art-to-unicode 1de2351 09/42: [aa2u int] Compute vertical/horizontal components separately., Stefan Monnier, 2020/11/29
- [elpa] externals/ascii-art-to-unicode 1dd85cc 10/42: [aa2u] Make weight dynamically customizable., Stefan Monnier, 2020/11/29
- [elpa] externals/ascii-art-to-unicode 9ab9dbc 03/42: [aa2u] Release: 1.5, Stefan Monnier, 2020/11/29
- [elpa] externals/ascii-art-to-unicode c6fac9c 12/42: fixup! [aa2u] Make weight dynamically customizable., Stefan Monnier, 2020/11/29