commit ea2e5de960c2cf6977f6c10a741582bea4e2f070
parent 5af2947cd878465c650f2a09d8adb919037af5ed
Author: Iqbal Ansari <iqbal.ansari@ignitesol.com>
Date: Mon, 26 Oct 2015 11:40:22 +0530
Handle emojis with quotes/comment characters
Diffstat:
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/emojify.el b/emojify.el
@@ -1,9 +1,8 @@
;; -*- lexical-binding: t; -*-
;; Another plugin to waste time in Emacs :sweat: :worried: :unamused: :p :) :p :p
;;
-;; TODO: Bug in org-capture (what causes this)
-;; Sometimes point is changed after adding emoji
-;; Custom images
+;; TODO: Custom images
+;; Benchmark
;; Cleanup
(require 'json)
@@ -42,8 +41,13 @@
"Emojify the text between start and end"
;; TODO Generalize these into a set of predicates
(when (and (or (not (derived-mode-p 'prog-mode))
- ;; TODO: Handle emojis with quotes or comment character :sweat:
- (nth 8 (syntax-ppss)))
+ ;; TODO: How (in)efficient is this
+ (and (save-excursion
+ (goto-char start)
+ (nth 8 (syntax-ppss)))
+ (save-excursion
+ (goto-char end)
+ (nth 8 (syntax-ppss)))))
(or (not (char-before start))
;; 32 space since ? i.e. (? followed by a space is not readable)
(memq (char-syntax (char-before start)) '(32 ?- ?<)))