浏览代码

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.
David Maus 13 年之前
父节点
当前提交
e47fcaae35
共有 2 个文件被更改,包括 10 次插入1 次删除
  1. 9 0
      lisp/org-compat.el
  2. 1 1
      lisp/org-exp.el

+ 9 - 0
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)

+ 1 - 1
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)))