Update Emacs version requirement to 28.1+ for object-intervals support

Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-12-11 02:45:55 +00:00
parent d1428a0748
commit 7614916aca
2 changed files with 11 additions and 4 deletions

View File

@ -18,7 +18,9 @@ Inspired by [ov.el](https://github.com/emacsorphanage/ov) for overlays.
(require 'tp) (require 'tp)
``` ```
Dependencies: `dash` (for list manipulation utilities) **Requirements:**
- Emacs 28.1+ (uses `object-intervals` function)
- `dash` (for list manipulation utilities)
## Quick Start ## Quick Start

11
tp.el
View File

@ -4,7 +4,7 @@
;; Version: 0.1.0 ;; Version: 0.1.0
;; Keywords: convenience text-properties ;; Keywords: convenience text-properties
;; Package-Requires: ((emacs "27.1") (dash "2.19.1")) ;; Package-Requires: ((emacs "28.1") (dash "2.19.1"))
;; This program is free software; you can redistribute it and/or ;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as ;; modify it under the terms of the GNU General Public License as
@ -24,6 +24,8 @@
;; - Search and navigation functions for text properties ;; - Search and navigation functions for text properties
;; ;;
;; Inspired by https://github.com/emacsorphanage/ov ;; Inspired by https://github.com/emacsorphanage/ov
;;
;; Requires Emacs 28.1+ for `object-intervals' function.
;;; Code: ;;; Code:
@ -153,11 +155,13 @@ Returns a plist of all properties in the region."
props)) props))
;;; Text property intervals ;;; Text property intervals
;; Note: Uses `object-intervals' which requires Emacs 28.1+
(defun tp-intervals (start end &optional object) (defun tp-intervals (start end &optional object)
"Get all text property intervals from START to END in OBJECT. "Get all text property intervals from START to END in OBJECT.
OBJECT can be a buffer or string; nil defaults to current buffer. OBJECT can be a buffer or string; nil defaults to current buffer.
Returns a list of (START END PROPERTIES) for each interval." Returns a list of (START END PROPERTIES) for each interval.
Uses `object-intervals' (Emacs 28.1+)."
(let ((object (or object (current-buffer)))) (let ((object (or object (current-buffer))))
(cond (cond
((stringp object) ((stringp object)
@ -169,7 +173,8 @@ Returns a list of (START END PROPERTIES) for each interval."
(type-of object)))))) (type-of object))))))
(defun tp-empty-p (object) (defun tp-empty-p (object)
"Return t if OBJECT has no text properties." "Return t if OBJECT has no text properties.
Uses `object-intervals' (Emacs 28.1+)."
(null (object-intervals object))) (null (object-intervals object)))
(defun tp-intervals-map (function start end &optional object) (defun tp-intervals-map (function start end &optional object)