Fixed (ucs-names) API change in Emacs v26.
https://emacs.stackexchange.com/questions/43685/ucs-names-in-emacs-26-is-not-working-for-euro-sign
--- a/.emacs-my Wed Jul 11 14:49:36 2018 +0300
+++ b/.emacs-my Thu Jul 19 15:06:02 2018 +0300
@@ -747,10 +747,18 @@
(setq i (+ i 1))))
)
+(defun my--get-char (name)
+ "Get character by Unicode `name'."
+ (cond
+ ((>= 26 emacs-major-version)
+ (gethash name (ucs-names) t))
+ ((>= 23 emacs-major-version)
+ (cdr (assoc-string name (ucs-names))))
+ (t (error "Emacs version is too old and lacks Unicode support..."))))
+
(when (>= emacs-major-version 23)
- (define-key global-map "\C-x8g" (lambda nil (interactive) (ucs-insert `,(cdr (assoc-string "HRYVNIA SIGN" (ucs-names) t)))))
- (define-key global-map "\C-x8e" (lambda nil (interactive) (ucs-insert `,(cdr (assoc-string "EURO SIGN" (ucs-names) t)))))
- )
+ (define-key global-map "\C-x8g" (lambda nil (interactive) (ucs-insert (my--get-char "HRYVNIA SIGN"))))
+ (define-key global-map "\C-x8e" (lambda nil (interactive) (ucs-insert (my--get-char "EURO SIGN")))) )
;; generic-define-* before (require 'generic-x) allow load all useful extra modes.
(defvar generic-define-mswindows-modes t)