commit 64f8815888befea1797d6ba08b8bde3d529b12f7 parent d4c3d2fa448d52be1f898dffa30660c4bc1cdb4c Author: Iqbal Ansari <iqbal.ansari@ignitesol.com> Date: Thu, 29 Oct 2015 15:01:19 +0530 Move all buffer checks to `emojify-buffer-p' Diffstat:
M | emojify.el | | | 15 | ++++++--------- |
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/emojify.el b/emojify.el @@ -88,7 +88,9 @@ a non-nil value." (string-match-p "\\*helm" (buffer-name buffer))) (defun emojify-buffer-p (buffer) - (not (run-hook-with-args-until-success 'emojify-inhibit-in-buffer-functions buffer))) + (not (or (emojify-ephemeral-buffer-p (current-buffer)) + (emojify-inhibit-major-mode-p (current-buffer)) + (run-hook-with-args-until-success 'emojify-inhibit-in-buffer-functions buffer)))) @@ -206,15 +208,10 @@ BEG and END are the beginning and end of the region respectively" ;; Display unconditionally in non-prog mode (when (and (or (not (derived-mode-p 'prog-mode)) ;; In prog mode enable respecting `emojify-prog-contexts' - (emojify-valid-prog-context-p match-beginning - match-end)) + (emojify-valid-prog-context-p match-beginning match-end)) + ;; The text is at the beginning of the buffer - (emojify-valid-text-context-p match-beginning - match-end) - ;; Allow user to inhibit display - (not (emojify-ephemeral-buffer-p (current-buffer))) - (not (emojify-inhibit-major-mode-p (current-buffer))) - (not (run-hook-with-args-until-success 'emojify-inhibit-hooks))) + (emojify-valid-text-context-p match-beginning match-end) ;; TODO: Remove double checks (when (gethash match emoji-parsed)