emacs-emojify

fork of https://github.com/iqbalansari/emacs-emojify
Log | Files | Refs | LICENSE

commit a3db62970d61cac4bfba7585a7855dcf0406c517
parent 2057bd35751a42e6731c22b46d4c7c11a282822f
Author: Iqbal Ansari <iqbalansari02@yahoo.com>
Date:   Thu,  5 Nov 2015 22:22:51 +0530

Rename `emojify-preferred-style` => `emojify-emoji-style`

Diffstat:
Memojify.el | 15++++++++-------
Mtest/emojify-test.el | 6+++---
Mtest/test-helper.el | 4++--
3 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/emojify.el b/emojify.el @@ -187,8 +187,8 @@ can customize `emojify-inhibit-major-modes' and (json-object-type 'hash-table)) (json-read-file emojify-emoji-json))) - (unless (eq emojify-preferred-style 'all) - (let ((style (symbol-name emojify-preferred-style))) + (unless (eq emojify-emoji-style 'all) + (let ((style (symbol-name emojify-emoji-style))) (ht-reject! (lambda (_key value) (not (string= style (ht-get value "style")))) emojify-emojis))) @@ -197,10 +197,10 @@ can customize `emojify-inhibit-major-modes' and (regexp-opt emojis)))) ;;;###autoload -(defun emojify-set-preferred-style (value) +(defun emojify-set-emoji-style (value) "Set the type of emojis that should be displayed. -VALUE is the value to be used as preferred style, see `emojify-preferred-style'" +VALUE is the value to be used as preferred style, see `emojify-emoji-style'" (let ((style (if (consp value) (eval value) value))) @@ -208,7 +208,7 @@ VALUE is the value to be used as preferred style, see `emojify-preferred-style'" (user-error "[emojify] Do not know how to use `%s' style, please set to one of %s" value '(all github ascii))) - (setq-default emojify-preferred-style style) + (setq-default emojify-emoji-style style) ;; Update emoji data (emojify-set-emoji-data) @@ -221,7 +221,7 @@ VALUE is the value to be used as preferred style, see `emojify-preferred-style'" (emojify-redisplay-emojis)))) (buffer-list))))) -(defcustom emojify-preferred-style +(defcustom emojify-emoji-style 'all "The type of emojis that should be displayed. @@ -234,7 +234,8 @@ These can have one of the following values (const :tag "Display only ascii emojis" ascii) (const :tag "Display only github emojis" github) (const :tag "Display all emojis" all)) - :set (lambda (_ value) (emojify-set-preferred-style value))) + :set (lambda (_ value) (emojify-set-emoji-style value)) + :group 'emojify) (defcustom emojify-prog-contexts 'both diff --git a/test/emojify-test.el b/test/emojify-test.el @@ -96,7 +96,7 @@ (emojify-tests-with-emojified-static-buffer ":) :smile:" (let ((ascii-emoji-pos (point-min)) (github-emoji-pos (+ (point-min) (length ":) ")))) - (emojify-set-preferred-style 'github) + (emojify-set-emoji-style 'github) ;; Ascii emoji should not be displayed (emojify-tests-should-not-be-emojified ascii-emoji-pos) @@ -104,7 +104,7 @@ ;; Github emojis should be displayed (emojify-tests-should-be-emojified github-emoji-pos) - (emojify-set-preferred-style 'ascii) + (emojify-set-emoji-style 'ascii) ;; Ascii emoji should be displayed (emojify-tests-should-be-emojified ascii-emoji-pos) @@ -112,7 +112,7 @@ ;; Github emojis should not be displayed (emojify-tests-should-not-be-emojified github-emoji-pos) - (emojify-set-preferred-style 'all) + (emojify-set-emoji-style 'all) ;; Ascii emoji should not be displayed (emojify-tests-should-be-emojified ascii-emoji-pos) diff --git a/test/test-helper.el b/test/test-helper.el @@ -36,7 +36,7 @@ Helps isolate tests from each other's customizations." (emojify-saved-display-style emojify-display-style) (emojify-saved-inhibit-major-modes emojify-inhibit-major-modes) (emojify-saved-inhibit-in-buffer-functions emojify-inhibit-in-buffer-functions) - (emojify-saved-preferred-style emojify-preferred-style) + (emojify-saved-emoji-style emojify-emoji-style) (emojify-saved-prog-contexts emojify-prog-contexts) (emojify-saved-inhibit-functions emojify-inhibit-functions) (emojify-saved-point-entered-behaviour emojify-point-entered-behaviour) @@ -55,7 +55,7 @@ Helps isolate tests from each other's customizations." emojify-show-help emojify-saved-show-help) ;; This as a side-effect also re-reads JSON data so no need to ;; re-adjust changes to emojify-emoji-json - (emojify-set-preferred-style emojify-saved-preferred-style)))) + (emojify-set-emoji-style emojify-saved-emoji-style)))) (defmacro emojify-tests-with-emojified-buffer (str &rest forms) (declare (indent 1))