emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/undo-tree 309f4bc 066/195: Define region-active-p if no


From: Stefan Monnier
Subject: [elpa] externals/undo-tree 309f4bc 066/195: Define region-active-p if not already defined, for compatibility
Date: Sat, 28 Nov 2020 13:41:23 -0500 (EST)

branch: externals/undo-tree
commit 309f4bcbb067e438cd030adaff0e8a56207de6e3
Author: Toby S. Cubitt <toby-undo-tree@dr-qubit.org>
Commit: Toby S. Cubitt <toby-undo-tree@dr-qubit.org>

    Define region-active-p if not already defined, for compatibility
    with older Emacsen.
---
 undo-tree.el | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/undo-tree.el b/undo-tree.el
index 2fc0d17..5cab425 100644
--- a/undo-tree.el
+++ b/undo-tree.el
@@ -611,6 +611,8 @@
 ;; * fixed bugs in `undo-list-transfer-to-tree' and
 ;;   `undo-list-rebuild-from-tree' which caused errors when undo history was
 ;;   empty or disabled
+;; * defun `region-active-p' if not already defined, for compatibility with
+;;   older Emacsen
 ;;
 ;; Version 0.2.1
 ;; * modified `undo-tree-node' defstruct and macros to allow arbitrary
@@ -691,6 +693,11 @@
 (unless (fboundp 'characterp)
   (defalias 'characterp 'char-valid-p))
 
+;; `region-active-p' isn't defined in Emacs versions <= 22
+(unless (fboundp 'region-active-p)
+  (defun region-active-p () (and transient-mark-mode mark-active)))
+
+
 
 ;;; =====================================================================
 ;;;              Global variables and customization options



reply via email to

[Prev in Thread] Current Thread [Next in Thread]