bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#28688: 26.0.60; Making ucs-names hash tables breaks aa2u, counsel pa


From: Kaushal Modi
Subject: bug#28688: 26.0.60; Making ucs-names hash tables breaks aa2u, counsel packages
Date: Tue, 03 Oct 2017 15:40:46 +0000

Hi Mark,

Can you please review the aa2u package in GNU Elpa?

https://elpa.gnu.org/packages/ascii-art-to-unicode.html

In there, there is this function which triggers error after this change[1]:

(defun aa2u-1c (stringifier &rest components)
  "Apply STRINGIFIER to COMPONENTS; return the UCS char w/ this name.
The char is a string (of length one), with two properties:

  aa2u-stringifier
  aa2u-components

Their values are STRINGIFIER and COMPONENTS, respectively."
  (let ((s (string (cdr (assoc-string (apply stringifier components)
                                      (ucs-names))))))
    (propertize s
                'aa2u-stringifier stringifier
                'aa2u-components components)))

Can you please update the package so that it works whether ucs-names is a hash-table or a list?

I also realized that it broke the counsel-unicode-char interactive function in the counsel.el package too:

(defun counsel-unicode-char (&optional count)
  "Insert COUNT copies of a Unicode character at point.
COUNT defaults to 1."
  (interactive "p")
  (let ((minibuffer-allow-text-properties t)
        (ivy-sort-max-size (expt 256 6)))
    (setq ivy-completion-beg (point))
    (setq ivy-completion-end (point))
    (ivy-read "Unicode name: "
              (nreverse
               (mapcar (lambda (x)
                         (propertize
                          (format "%06X % -60s%c" (cdr x) (car x) (cdr x))
                          'result (cdr x)))
                       (ucs-names)))
              :action (lambda (char)
                        (with-ivy-window
                          (delete-region ivy-completion-beg ivy-completion-end)
                          (setq ivy-completion-beg (point))
                          (insert-char (get-text-property 0 'result char) count)
                          (setq ivy-completion-end (point))))
              :history 'counsel-unicode-char-history
              :sort t)))

[1]: http://git.savannah.gnu.org/cgit/emacs.git/commit/?h=emacs-26&id=96c2c098aeed5c85733577ebbdaf33af6fbb59e9
--

Kaushal Modi


reply via email to

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