emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[nongnu] elpa/eglot-inactive-regions 7e4eb584e0 61/66: fallback to depre


From: ELPA Syncer
Subject: [nongnu] elpa/eglot-inactive-regions 7e4eb584e0 61/66: fallback to deprecated functions
Date: Fri, 6 Dec 2024 06:59:58 -0500 (EST)

branch: elpa/eglot-inactive-regions
commit 7e4eb584e0a8d344deae9d22673cb2bc84baea95
Author: Filippo Argiolas <filippo.argiolas@gmail.com>
Commit: Filippo Argiolas <filippo.argiolas@gmail.com>

    fallback to deprecated functions
---
 eglot-inactive-regions.el | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/eglot-inactive-regions.el b/eglot-inactive-regions.el
index cd36a1a166..cb0deb549c 100644
--- a/eglot-inactive-regions.el
+++ b/eglot-inactive-regions.el
@@ -297,9 +297,21 @@ Useful to update colors after a face or theme change."
       (setq eglot-inactive-regions--active nil)))
   (remove-hook 'change-major-mode-hook #'eglot-inactive-regions-cleanup))
 
+(defun eglot-inactive-regions--uri-to-path (uri)
+  "Fallback to deprecated uri-to-path URI if new function is not available."
+  (if (fboundp 'eglot-uri-to-path)
+      (eglot-uri-to-path uri)
+    (eglot--uri-to-path uri)))
+
+(defun eglot-inactive-regions--range-region (range)
+  "Fallback to deprecated range-region RANGE if new function is not available."
+  (if (fboundp 'eglot-range-region)
+      (eglot-range-region range)
+    (eglot--range-region range)))
+
 (defun eglot-inactive-regions--handle-notification (uri regions)
   "Update inactive REGIONS for the buffer corresponding to URI."
-  (when-let* ((path (expand-file-name (eglot--uri-to-path uri)))
+  (when-let* ((path (expand-file-name (eglot-inactive-regions--uri-to-path 
uri)))
               (buffer (find-buffer-visiting path)))
       (with-current-buffer buffer
         (when eglot-inactive-regions-mode
@@ -308,7 +320,7 @@ Useful to update colors after a face or theme change."
           (setq eglot-inactive-regions--ranges '())
           (cl-loop
            for r across regions
-           for (beg . end) = (eglot--range-region r)
+           for (beg . end) = (eglot-inactive-regions--range-region r)
            do
            (push (cons beg end) eglot-inactive-regions--ranges))
           (eglot-inactive-regions-refresh)))))



reply via email to

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