ttn pushed a commit to branch master in repository elpa. commit 1d086771492d8fde0241d652e83ca485506b9d27 Author: Thien-Thi Nguyen <t...@gnu.org> Date: Thu May 8 11:41:43 2014 +0200
[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/ascii-art-to-unicode.el | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 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 894187e..cd3126d 100644 --- a/packages/ascii-art-to-unicode/ascii-art-to-unicode.el +++ b/packages/ascii-art-to-unicode/ascii-art-to-unicode.el @@ -231,7 +231,7 @@ Their values are STRINGIFIER and COMPONENTS, respectively." ;;; command ;;;###autoload -(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))) (save-excursion (save-restriction (widen)