From e47fcaae355f3097740c1039426b3aecafe90d5d Mon Sep 17 00:00:00 2001 From: David Maus Date: Sun, 29 May 2011 20:50:18 +0200 Subject: [PATCH] Provide compatibility function for `activate-mark' * org-exp.el (org-export): Use new compatibility function `org-activate-mark'. * org-compat.el (org-activate-mark): New function. Provide `activate-mark' if not present (e.g. Emacs22). Emacs 22 misses this function. Defun copied from Emac23's `active-mark' but removed reference to customization variable `select-active-regions' which is not present in Emacs22. --- lisp/org-compat.el | 9 +++++++++ lisp/org-exp.el | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lisp/org-compat.el b/lisp/org-compat.el index e5a691079..cc9b5b909 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -247,6 +247,15 @@ Works on both Emacs and XEmacs." (> (point) (region-beginning))) (exchange-point-and-mark))) +;; Emacs 22 misses `activate-mark' +(if (fboundp 'activate-mark) + (defalias 'org-activate-mark 'activate-mark) + (defun org-activate-mark () + (when (mark t) + (setq mark-active t) + (unless transient-mark-mode + (setq transient-mark-mode 'lambda))))) + ;; Invisibility compatibility (defun org-remove-from-invisibility-spec (arg) diff --git a/lisp/org-exp.el b/lisp/org-exp.el index d6ed193c4..1487d687a 100644 --- a/lisp/org-exp.el +++ b/lisp/org-exp.el @@ -1031,7 +1031,7 @@ Pressing `1' will switch between these two options." (set-process-sentinel p 'org-export-process-sentinel) (message "Background process \"%s\": started" p)) ;; background processing not requested, or not possible - (if subtree-p (progn (org-mark-subtree) (activate-mark))) + (if subtree-p (progn (org-mark-subtree) (org-activate-mark))) (call-interactively (nth 1 ass)) (when (and bpos (get-buffer-window cbuf)) (let ((cw (selected-window))) -- 2.11.4.GIT