diff options
| author | Thien-Thi Nguyen <ttn@gnu.org> | 2014-05-08 11:41:43 +0200 |
|---|---|---|
| committer | Thien-Thi Nguyen <ttn@gnu.org> | 2014-05-08 11:45:03 +0200 |
| commit | 42f07bceb096b1d254be43e3480a168327192d6d (patch) | |
| tree | 2c14badc819aa5f93b1c7b888cd1a0f0c8db31a3 | |
| parent | 9ab9dbca3882dceb080a02082ad6f521dac81f9f (diff) | |
[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.
| -rw-r--r-- | ascii-art-to-unicode.el | 12 |
1 files 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 ;;;###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) |
