commit 8ba9c99b2efbdd3923212bbe5688c9d7bc67fb04 parent c2dd14511962de2142551c5dc0246d276a149c03 Author: Iqbal Ansari <iqbalansari02@yahoo.com> Date: Mon, 2 Nov 2015 23:16:15 +0530 Also run the point-entered hooks in advice around `isearch-repeat` Basically a better version of d9c12833c92c6d0f4d4d7c8b709f48c52bf8cddb Diffstat:
M | emojify.el | | | 21 | ++++++++++++++++----- |
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/emojify.el b/emojify.el @@ -578,13 +578,24 @@ of `after-change-functions' to understand the meaning of BEG, END and LEN." (ad-activate #'text-scale-increase) (defadvice isearch-repeat (around emojify-redisplay-after-isearch-left (&rest ignored)) - "Redisplay emojis after isearch." + "Advice `isearch-repeat' to run emojify's point motion hooks. + +By default isearch disables point-motion hooks while repeating breaking +emojify's uncovering logic, this advice explicitly runs (only emojify's) point +motion hooks." (when emojify-mode - (let ((start (line-beginning-position)) - (end (line-end-position))) + (let ((old-pos (point))) (prog1 ad-do-it - (when (< (point) end) - (emojify-redisplay-emojis start end)))))) + (let ((old-pos-props (text-properties-at old-pos)) + (new-pos-props (text-properties-at (point)))) + (unless (equal old-pos (point)) + (when (and (plist-get old-pos-props 'emojified) + (plist-get old-pos-props 'point-left)) + (funcall (plist-get old-pos-props 'point-left) old-pos (point))) + (when (and (plist-get new-pos-props 'emojified) + (plist-get new-pos-props 'point-entered)) + (funcall (plist-get new-pos-props 'point-entered) old-pos (point))))))))) + (ad-activate #'isearch-repeat)