From b43e33b09376b6bb7dbbb66bc371b6466bd2469e Mon Sep 17 00:00:00 2001 From: blais Date: Thu, 24 Aug 2006 19:21:10 +0000 Subject: [PATCH] Applied patch from Denis Shaposhnikov for Xemacs portability. Thanks Denis. git-svn-id: https://docutils.svn.sourceforge.net/svnroot/docutils/trunk/docutils@4700 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- tools/editors/emacs/rst.el | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/editors/emacs/rst.el b/tools/editors/emacs/rst.el index ffa1f1b27..421fd6179 100644 --- a/tools/editors/emacs/rst.el +++ b/tools/editors/emacs/rst.el @@ -940,7 +940,7 @@ b. a negative numerical argument, which generally inverts the (toggle-style (and current-prefix-arg (not reverse-direction)))) - (if (and transient-mark-mode mark-active) + (if (rst-portable-mark-active-p) ;; Adjust decorations within region. (rst-promote-region current-prefix-arg) ;; Adjust decoration around point. @@ -2004,7 +2004,7 @@ EVENT is the input event." (error "Cannot mark zero sections")) (cond ((and allow-extend (or (and (eq last-command this-command) (mark t)) - (and transient-mark-mode mark-active))) + (rst-portable-mark-active-p))) (set-mark (save-excursion (goto-char (mark)) @@ -3375,6 +3375,16 @@ column is used (fill-column vs. end of previous/next line)." )) +(defun rst-portable-mark-active-p () + "A portable (GNU, Xemacs) function that returns true if the +mark is active." + (or + (and (fboundp 'region-active-p) + (region-active-p) (region-exists-p)) + (and (boundp 'transient-mark-mode) + transient-mark-mode mark-active))) + + (provide 'rst) ;;; rst.el ends here -- 2.11.4.GIT