commit 7c6c9126d7c6ef1ea3a823f75d456476c44bbcf9
parent f33dcffb2cc9748710b6793331104ba5a8bb9db8
Author: Iqbal Ansari <iqbal.ansari@ignitesol.com>
Date: Sat, 16 Jul 2016 11:51:34 +0530
Merge branch 'develop'
Diffstat:
3 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/.travis.yml b/.travis.yml
@@ -36,7 +36,7 @@ install:
- cask install
script:
- - cask exec ert-runner
+ - find . -name '*.elc' -delete && cask exec ert-runner
notifications:
email:
diff --git a/emojify.el b/emojify.el
@@ -225,11 +225,6 @@ visible in the selected window."
:type 'directory
:group 'emojify)
-(defcustom emojify-image-dir
- (expand-file-name emojify-emoji-set
- emojify-emojis-dir)
- "Path to emoji images.")
-
(defcustom emojify-display-style
'image
"How the emoji's be displayed.
@@ -590,6 +585,11 @@ To understand WINDOW, STRING and POS see the function documentation for
(define-key map [remap backward-delete-char-untabify] #'emojify-delete-emoji-backward)
map))
+(defun emojify-image-dir ()
+ "Get the path to directory containing images for currently selected emoji set."
+ (expand-file-name emojify-emoji-set
+ emojify-emojis-dir))
+
(defun emojify--get-point-left-function (buffer match-beginning match-end)
"Create a function that can be executed in point-left hook for emoji text.
@@ -717,7 +717,7 @@ selection, but for some reason it does not work well."
DATA holds the emoji data, BEG and END delimit the region where emoji will
be displayed."
(let* ((image-file (expand-file-name (ht-get data "image")
- emojify-image-dir))
+ (emojify-image-dir)))
(image-type (intern (upcase (file-name-extension image-file)))))
(when (file-exists-p image-file)
(create-image image-file
@@ -1037,7 +1037,7 @@ of the window. DISPLAY-START corresponds to the new start of the window."
(defun emojify-download-emoji-maybe ()
"Download emoji images if needed."
(when (and (equal emojify-display-style 'image)
- (not (file-exists-p emojify-image-dir))
+ (not (file-exists-p (emojify-image-dir)))
(not emojify--refused-image-download-p))
(unwind-protect
;; Do not prompt for download if download is in progress
diff --git a/test/test-helper.el b/test/test-helper.el
@@ -11,7 +11,10 @@
".cask")))
(if (not project-dir)
(user-error "Could not locate project root")
- (let ((default-directory (expand-file-name (concat ".cask/" emacs-version) project-dir)))
+ (let ((default-directory (expand-file-name (format ".cask/%d.%d"
+ emacs-major-version
+ emacs-minor-version)
+ project-dir)))
(normal-top-level-add-subdirs-to-load-path))
(add-to-list 'load-path project-dir)))
@@ -32,7 +35,6 @@
Helps isolate tests from each other's customizations."
(declare (indent 0))
`(let ((emojify-saved-emoji-json emojify-emoji-json)
- (emojify-saved-image-dir emojify-image-dir)
(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)
@@ -45,11 +47,10 @@ Helps isolate tests from each other's customizations."
(emojify-debug-mode t))
(unwind-protect
(progn
- (unless (file-exists-p emojify-image-dir)
+ (unless (file-exists-p (emojify-image-dir))
(emojify-download-emoji emojify-emoji-set))
,@forms)
(setq emojify-emoji-json emojify-saved-emoji-json
- emojify-image-dir emojify-saved-image-dir
emojify-display-style emojify-saved-display-style
emojify-inhibit-major-modes emojify-saved-inhibit-major-modes
emojify-inhibit-in-buffer-functions emojify-saved-inhibit-in-buffer-functions