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

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

[elpa] externals/undo-tree 2b0395a 096/195: Added called-interactively-p


From: Stefan Monnier
Subject: [elpa] externals/undo-tree 2b0395a 096/195: Added called-interactively-p compatibility hack for Emacs <= 23.1
Date: Sat, 28 Nov 2020 13:41:29 -0500 (EST)

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

    Added called-interactively-p compatibility hack for Emacs <= 23.1
---
 undo-tree.el | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git a/undo-tree.el b/undo-tree.el
index c9bf8a5..1f9a733 100644
--- a/undo-tree.el
+++ b/undo-tree.el
@@ -627,11 +627,10 @@
 ;;
 ;; Version 0.5
 ;; * implemented diff display in visualizer, toggled on and off using
-;;   `undo-tree-visualizer-toggle-diff' and
-;;   `undo-tree-visualizer-selection-toggle-diff' in the visualizer.
-;; * added `undo-tree-diff' to generate diff between the current state and
-;;   given state, and `undo-tree-visualizer-update-diff' to update visualizer
-;;   diff display
+;;   `undo-tree-visualizer-toggle-diff'
+;; * added `undo-tree-visualizer-diff' customization option, to display diff
+;;   by default
+;; * added `called-interactively-p' compatibility hack for Emacs <= 23.1
 ;;
 ;; Version 0.4
 ;; * implemented persistent history storage: `undo-tree-save-history' and
@@ -783,6 +782,16 @@
 (unless (fboundp 'region-active-p)
   (defun region-active-p () (and transient-mark-mode mark-active)))
 
+;; `called-interactively-p' doesn't take an argument in Emacs <= 22, but
+;; *requires* an argument in Emacs >= 23.1 (thus forcing us to use around
+;; advice if we want to avoid changing the main code)
+(when (or (<= emacs-major-version 22)
+         (and (= emacs-major-version 23)
+              (<= emacs-minor-version 21)))
+  (defadvice called-interactively-p
+    (around undo-tree (&optional kind) activate compile preactivate)
+    ad-do-it)1)
+
 
 
 ;;; =====================================================================



reply via email to

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