commit 854fa508f2cbb3b503264a348637fa7f54e1499a parent 106c3a6c9d75780d01d193d659bf61e19c47418d Author: Iqbal Ansari <iqbalansari02@yahoo.com> Date: Wed, 16 Mar 2016 22:03:16 +0530 Simplify emojify--get-text-display-props Diffstat:
M | emojify.el | | | 22 | ++++++++++------------ |
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/emojify.el b/emojify.el @@ -775,20 +775,18 @@ DATA holds the emoji data, _BEG and _END delimit the region where emoji will be displayed." (ht-get data "ascii")) -(defun emojify--get-text-display-props (text beg end) - "Get the display property for an emoji. +(defun emojify--get-text-display-props (emoji beg end) + "Get the display property for an EMOJI. TEXT is the text to be displayed as emoji, BEG and END delimit the region containing the emoji." - (let ((emoji-data (ht-get emojify-emojis text))) - (when emoji-data - (funcall (pcase emojify-display-style - (`image #'emojify--get-image-display) - (`unicode #'emojify--get-unicode-display) - (`ascii #'emojify--get-ascii-display)) - emoji-data - beg - end)))) + (funcall (pcase emojify-display-style + (`image #'emojify--get-image-display) + (`unicode #'emojify--get-unicode-display) + (`ascii #'emojify--get-ascii-display)) + emoji + beg + end)) (defun emojify-display-emojis-in-region (beg end) "Display emojis in region. @@ -829,7 +827,7 @@ TODO: Skip emojifying if region is already emojified." (not (run-hook-with-args-until-success 'emojify-inhibit-functions match match-beginning match-end))) - (let ((display-prop (emojify--get-text-display-props match match-beginning match-end))) + (let ((display-prop (emojify--get-text-display-props emoji match-beginning match-end))) (when display-prop (add-text-properties match-beginning match-end