emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] master c00a555: [aa2u slog] Handle ‘ucs-names’ that returns a ha


From: Thien-Thi Nguyen
Subject: [elpa] master c00a555: [aa2u slog] Handle ‘ucs-names’ that returns a hash table.
Date: Tue, 3 Oct 2017 15:22:59 -0400 (EDT)

branch: master
commit c00a555290720481a7b502d7bb3c1515dc2e337a
Author: Thien-Thi Nguyen <address@hidden>
Commit: Thien-Thi Nguyen <address@hidden>

    [aa2u slog] Handle ‘ucs-names’ that returns a hash table.
    
    Reported by Kaushal Modi (bug#28688):
    http://lists.gnu.org/archive/html/bug-gnu-emacs/2017-10/threads.html
    
    * packages/ascii-art-to-unicode/ascii-art-to-unicode.el
    (aa2u--lookup): New alias.
    (aa2u-1c): Use ‘aa2u--lookup’.
---
 packages/ascii-art-to-unicode/ascii-art-to-unicode.el | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

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 9223662..c602ff5 100644
--- a/packages/ascii-art-to-unicode/ascii-art-to-unicode.el
+++ b/packages/ascii-art-to-unicode/ascii-art-to-unicode.el
@@ -111,6 +111,14 @@ This specifies the weight of all the lines.")
 ;;;---------------------------------------------------------------------------
 ;;; support
 
+(defalias 'aa2u--lookup
+  ;; Keep some slack: don't ‘eval-when-compile’ here.
+  (if (hash-table-p (ucs-names))
+      ;; Emacs 26 and later
+      #'gethash
+    ;; prior to Emacs 26
+    #'assoc-string))
+
 (defsubst aa2u--text-p (pos)
   (get-text-property pos 'aa2u-text))
 
@@ -145,7 +153,7 @@ The char is a string (of length one), with two properties:
   aa2u-components
 
 Their values are STRINGIFIER and COMPONENTS, respectively."
-  (let ((s (string (cdr (assoc-string (apply stringifier components)
+  (let ((s (string (cdr (aa2u--lookup (apply stringifier components)
                                       (ucs-names))))))
     (propertize s
                 'aa2u-stringifier stringifier



reply via email to

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