summaryrefslogtreecommitdiff
path: root/lisp/progmodes
diff options
context:
space:
mode:
authorJoão Távora <joaotavora@gmail.com>2023-04-07 19:45:28 +0100
committerJoão Távora <joaotavora@gmail.com>2023-04-07 19:45:28 +0100
commit6cc5fe77244b76f00ec680873087b17ca38f776f (patch)
treea23a9c981bfae93891ecd833fe2a1e411e80613b /lisp/progmodes
parent7239098ad436a10afddce117ab224189f6bd6b7f (diff)
downloademacs-6cc5fe77244b76f00ec680873087b17ca38f776f.tar.gz
Eglot: require optional text-property-search.el
Originally reported in https://github.com/joaotavora/eglot/discussions/1201. Also check for text-property-search-forward before using it, so we won't break on Emacs 26.3. At this point, better start relying on compat.el, I guess. * lisp/progmodes/eglot.el (eglot--format-markup): Check for text-property-search-forward.
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/eglot.el8
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/progmodes/eglot.el b/lisp/progmodes/eglot.el
index da7e53730e7..8e665e28a53 100644
--- a/lisp/progmodes/eglot.el
+++ b/lisp/progmodes/eglot.el
@@ -107,6 +107,7 @@
(require 'subr-x))
(require 'filenotify)
(require 'ert)
+(require 'text-property-search nil t)
;; These dependencies are also GNU ELPA core packages. Because of
;; bug#62576, since there is a risk that M-x package-install, despite
@@ -1673,9 +1674,10 @@ Doubles as an indicator of snippet support."
(font-lock-ensure)
(goto-char (point-min))
(let ((inhibit-read-only t))
- (while (setq match (text-property-search-forward 'invisible))
- (delete-region (prop-match-beginning match)
- (prop-match-end match))))
+ (when (fboundp 'text-property-search-forward) ;; FIXME: use compat
+ (while (setq match (text-property-search-forward 'invisible))
+ (delete-region (prop-match-beginning match)
+ (prop-match-end match)))))
(string-trim (buffer-string))))))
(define-obsolete-variable-alias 'eglot-ignored-server-capabilites