commit ba66bc2c72214bff5ead10c9adf0dcf4ab89ae78
parent 5c8eb887ee229481c62f24de016f6cbbba15ce80
Author: Iqbal Ansari <iqbal.ansari@ignitesol.com>
Date: Mon, 30 Nov 2015 16:28:49 +0530
Minor restructuring
Diffstat:
1 file changed, 14 insertions(+), 16 deletions(-)
diff --git a/emojify.el b/emojify.el
@@ -106,6 +106,20 @@ errors during operation.")
(ignore-errors
,@forms)))
+(defmacro emojify-with-saved-buffer-state (&rest forms)
+ "Execute FORMS saving current buffer state.
+
+This saves point and mark, `match-data' and buffer modification state it also
+inhibits buffer change, point motion hooks."
+ (declare (debug t) (indent 0))
+ `(let ((inhibit-point-motion-hooks t))
+ (with-silent-modifications
+ (save-match-data
+ (save-excursion
+ (save-restriction
+ (widen)
+ ,@forms))))))
+
(defun emojify-message (format-string &rest args)
"Log debugging messages to buffer named 'emojify-log'.
@@ -648,22 +662,6 @@ region containing the emoji."
(when display
(list 'display display))))
-(defmacro emojify-with-saved-buffer-state (&rest forms)
- "Execute FORMS saving current buffer state.
-
-This saves point and mark, `match-data' and buffer modification state it also
-inhibits buffer change, point motion hooks.
-
-Used by `emojify-display-emojis-in-region' and `emojify-undisplay-emojis-in-region'"
- (declare (debug t) (indent 0))
- `(let ((inhibit-point-motion-hooks t))
- (with-silent-modifications
- (save-match-data
- (save-excursion
- (save-restriction
- (widen)
- ,@forms))))))
-
(defun emojify-display-emojis-in-region (beg end)
"Display emojis in region.