From 81d3f9bb3e1cd08f087a9019a3d84257af1b584b Mon Sep 17 00:00:00 2001 From: Elis Axelsson Date: Sat, 8 Oct 2016 07:53:10 +0200 Subject: [PATCH] Namespace wrapper for save-mark-and-excursion --- webpaste.el | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/webpaste.el b/webpaste.el index 8493f0c..0983c36 100644 --- a/webpaste.el +++ b/webpaste.el @@ -178,17 +178,17 @@ When we run out of providers to try, it will restart since "Paste current buffer to some paste service." (interactive) - (save-mark-and-excursion + (webpaste-save-mark-and-excursion (set-mark (point-min)) ; Set mark on point-min (goto-char (point-max)) ; Go to point-max (webpaste-paste-region))) ; Paste region -;; Define macro for emacs <25 compability -(eval-when-compile - (when (< emacs-major-version 25) - (defmacro save-mark-and-excursion (&rest body) - `(save-excursion ,@body)))) +;; Define wrapper for save-excursion / save-mark-and-excursion +(defmacro webpaste-save-mark-and-excursion (&rest body) + (if (< emacs-major-version 25) + `(save-excursion ,@body) + `(save-mark-and-excursion ,@body))) (provide 'webpaste)