commit 790eaf7b86a5b0033a3a5844415d41d8a35e5108 parent 77cc93b39aa118c065a4c32bd0d29e6dd28f98a1 Author: Iqbal Ansari <iqbalansari02@yahoo.com> Date: Sun, 1 Nov 2015 13:26:12 +0530 Redisplay emojis on text resize Diffstat:
M | emojify.el | | | 16 | ++++++++++++++++ |
1 file changed, 16 insertions(+), 0 deletions(-)
diff --git a/emojify.el b/emojify.el @@ -510,6 +510,15 @@ BEG and END are the beginning and end of the region respectively" ;; Setup the next iteration (setq beg emoji-end))))) +(defun emojify-redisplay-emojis (&optional beg end) + "Redisplay emojis in region between BEG and END. + +Redisplay emojis in the entire buffer if BEG and END are not specified" + (let ((beg (or beg (point-min))) + (end (or end (point-max)))) + (emojify-undisplay-emojis-in-region beg end) + (emojify-display-emojis-in-region beg end))) + (defun emojify-after-change-function (beg end len) "Redisplay emojis in region after change. @@ -531,6 +540,13 @@ of `after-change-functions' to understand the meaning of BEG, END and LEN." +(defadvice text-scale-increase (after emojify-resize-emojis (&rest ignored)) + "Advice `text-scale-increase' to trigger resizing of emojis on resize." + (when emojify-mode + (emojify-redisplay-emojis))) + +(ad-activate #'text-scale-increase) + (defun emojify-turn-on-emojify-mode () "Turn on `emojify-mode' in current buffer."