From 7614916acaef3a0838d50f3e0a179eb94aa2ce44 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 11 Dec 2025 02:45:55 +0000 Subject: [PATCH] Update Emacs version requirement to 28.1+ for object-intervals support Co-authored-by: Kinneyzhang <38454496+Kinneyzhang@users.noreply.github.com> --- readme.md | 4 +++- tp.el | 11 ++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/readme.md b/readme.md index 65dd48f..7e4fdab 100644 --- a/readme.md +++ b/readme.md @@ -18,7 +18,9 @@ Inspired by [ov.el](https://github.com/emacsorphanage/ov) for overlays. (require 'tp) ``` -Dependencies: `dash` (for list manipulation utilities) +**Requirements:** +- Emacs 28.1+ (uses `object-intervals` function) +- `dash` (for list manipulation utilities) ## Quick Start diff --git a/tp.el b/tp.el index a21d96a..a111ef1 100644 --- a/tp.el +++ b/tp.el @@ -4,7 +4,7 @@ ;; Version: 0.1.0 ;; 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 ;; modify it under the terms of the GNU General Public License as @@ -24,6 +24,8 @@ ;; - Search and navigation functions for text properties ;; ;; Inspired by https://github.com/emacsorphanage/ov +;; +;; Requires Emacs 28.1+ for `object-intervals' function. ;;; Code: @@ -153,11 +155,13 @@ Returns a plist of all properties in the region." props)) ;;; Text property intervals +;; Note: Uses `object-intervals' which requires Emacs 28.1+ (defun tp-intervals (start end &optional object) "Get all text property intervals from START to END in OBJECT. 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)))) (cond ((stringp object) @@ -169,7 +173,8 @@ Returns a list of (START END PROPERTIES) for each interval." (type-of 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))) (defun tp-intervals-map (function start end &optional object)