aboutsummaryrefslogtreecommitdiff
path: root/compat-29.el
diff options
context:
space:
mode:
authorDaniel Mendler <mail@daniel-mendler.de>2023-01-17 23:49:05 +0100
committerDaniel Mendler <mail@daniel-mendler.de>2023-01-17 23:52:49 +0100
commit12e2d82a5a469aabadb1082678f7a33539779d8b (patch)
tree9d76ea346e2ab673c355516535d4570822415d04 /compat-29.el
parent64dc62259f1adc6ae70a38f7a874cee48dfa3626 (diff)
compat-29: Add delete-line
Diffstat (limited to 'compat-29.el')
-rw-r--r--compat-29.el28
1 files changed, 16 insertions, 12 deletions
diff --git a/compat-29.el b/compat-29.el
index e84c628..9373c0c 100644
--- a/compat-29.el
+++ b/compat-29.el
@@ -84,18 +84,6 @@ Unibyte strings are converted to multibyte for comparison."
(declare (pure t) (side-effect-free t))
(eq t (compare-strings string1 0 nil string2 0 nil t)))
-(compat-defun list-of-strings-p (object) ;; <compat-tests:lists-of-strings-p>
- "Return t if OBJECT is nil or a list of strings."
- (declare (pure t) (side-effect-free t))
- (while (and (consp object) (stringp (car object)))
- (setq object (cdr object)))
- (null object))
-
-(compat-defun plistp (object) ;; <compat-tests:plistp>
- "Non-nil if and only if OBJECT is a valid plist."
- (let ((len (proper-list-p object)))
- (and len (zerop (% len 2)))))
-
(compat-defun plist-get (plist prop &optional predicate) ;; <compat-tests:plist-get>
"Handle optional argument PREDICATE."
:explicit t
@@ -183,6 +171,22 @@ This function does not move point. Also see `line-end-position'."
;;;; Defined in subr.el
+(compat-defun list-of-strings-p (object) ;; <compat-tests:lists-of-strings-p>
+ "Return t if OBJECT is nil or a list of strings."
+ (declare (pure t) (side-effect-free t))
+ (while (and (consp object) (stringp (car object)))
+ (setq object (cdr object)))
+ (null object))
+
+(compat-defun plistp (object) ;; <compat-tests:plistp>
+ "Non-nil if and only if OBJECT is a valid plist."
+ (let ((len (proper-list-p object)))
+ (and len (zerop (% len 2)))))
+
+(compat-defun delete-line () ;; <compat-tests:delete-line>
+ "Delete the current line."
+ (delete-region (pos-bol) (pos-bol 2)))
+
(compat-defmacro with-memoization (place &rest code) ;; <compat-tests:with-memoization>
"Return the value of CODE and stash it in PLACE.
If PLACE's value is non-nil, then don't bother evaluating CODE