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

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

[nongnu] elpa/lua-mode d2ff304 456/468: Copy cl-signum into lua--signum


From: Philip Kaludercic
Subject: [nongnu] elpa/lua-mode d2ff304 456/468: Copy cl-signum into lua--signum for backward compat
Date: Thu, 5 Aug 2021 04:59:28 -0400 (EDT)

branch: elpa/lua-mode
commit d2ff3045b9694293a302fa60d7bd5d97f2673156
Author: immerrr <immerrr+lua@gmail.com>
Commit: immerrr <immerrr+lua@gmail.com>

    Copy cl-signum into lua--signum for backward compat
---
 lua-mode.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lua-mode.el b/lua-mode.el
index 63223d2..aae4706 100644
--- a/lua-mode.el
+++ b/lua-mode.el
@@ -958,6 +958,11 @@ Return the amount the indentation changed by."
              lua-indent-level))))))
 
 
+(defun lua--signum (x)
+  "Return 1 if X is positive, -1 if negative, 0 if zero."
+  ;; XXX: backport from cl-extras for Emacs24
+  (cond ((> x 0) 1) ((< x 0) -1) (t 0)))
+
 (defun lua--ensure-point-within-limit (limit backward)
   "Return non-nil if point is within LIMIT going forward.
 
@@ -965,7 +970,7 @@ With BACKWARD non-nil, return non-nil if point is within 
LIMIT
 going backward.
 
 If point is beyond limit, move it onto limit."
-  (if (= (cl-signum (- (point) limit))
+  (if (= (lua--signum (- (point) limit))
          (if backward 1 -1))
       t
     (goto-char limit)



reply via email to

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