[Top][All Lists]

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

[elpa] externals/ascii-art-to-unicode 42f07bc 04/42: [aa2u] Fix bug: Ma

From: Stefan Monnier
Subject: [elpa] externals/ascii-art-to-unicode 42f07bc 04/42: [aa2u] Fix bug: Make ‘M-x aa2u’ operate on accessible portion.
Date: Sun, 29 Nov 2020 18:57:03 -0500 (EST)

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

    [aa2u] Fix bug: Make ‘M-x aa2u’ operate on accessible portion.
    Regression introduced 2014-04-03, "Make ‘aa2u’ region-aware".
    * packages/ascii-art-to-unicode/ascii-art-to-unicode.el (aa2u):
    Take optional arg INTERACTIVE; add "p" to ‘interactive’ form;
    when INTERACTIVE and region is not active, set BEG, END.
 ascii-art-to-unicode.el | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/ascii-art-to-unicode.el b/ascii-art-to-unicode.el
index 894187e..cd3126d 100644
--- a/ascii-art-to-unicode.el
+++ b/ascii-art-to-unicode.el
@@ -231,7 +231,7 @@ Their values are STRINGIFIER and COMPONENTS, respectively."
 ;;; command
-(defun aa2u (beg end)
+(defun aa2u (beg end &optional interactive)
   "Convert simple ASCII art line drawings to Unicode.
 Specifically, perform the following replacements:
@@ -259,7 +259,15 @@ south, east and west neighbors.
 This command operates on either the active region,
 or the accessible portion otherwise."
-  (interactive "r")
+  (interactive "r\np")
+  ;; This weirdness, along w/ the undocumented "p" in the ‘interactive’
+  ;; form, is to allow ‘M-x aa2u’ (interactive invocation) w/ no region
+  ;; selected to default to the accessible portion (as documented), which
+  ;; was the norm in ascii-art-to-unicode.el prior to 1.5.  A bugfix,
+  ;; essentially.  This is ugly, unfortunately -- is there a better way?!
+  (when (and interactive (not (region-active-p)))
+    (setq beg (point-min)
+          end (point-max)))

reply via email to

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