emacs-diffs
[Top][All Lists]
Advanced

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

master 6cc5fe77244 2/3: Eglot: require optional text-property-search.el


From: João Távora
Subject: master 6cc5fe77244 2/3: Eglot: require optional text-property-search.el
Date: Fri, 7 Apr 2023 15:07:44 -0400 (EDT)

branch: master
commit 6cc5fe77244b76f00ec680873087b17ca38f776f
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    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.
---
 lisp/progmodes/eglot.el | 8 +++++---
 1 file 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



reply via email to

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