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

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

[elpa] externals/jarchive deda5a3d8d 2/2: Don't recommend running in a h


From: ELPA Syncer
Subject: [elpa] externals/jarchive deda5a3d8d 2/2: Don't recommend running in a hook, best to run once
Date: Sun, 13 Nov 2022 08:57:51 -0500 (EST)

branch: externals/jarchive
commit deda5a3d8d4f19f9c459358c011e8f4f4e74c2ec
Author: dannyfreeman <danny@dfreeman.email>
Commit: dannyfreeman <danny@dfreeman.email>

    Don't recommend running in a hook, best to run once
    
    Quite down some messages
---
 CHANGELOG.md |  5 +++++
 README.md    |  7 -------
 jarchive.el  | 14 +++++++-------
 3 files changed, 12 insertions(+), 14 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5bf10d007b..c141b085aa 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,10 @@
 # Change Log
 
+## 2022-11-13 0.4.0 Release Notes
+- Remove some unnecessary messages
+- Misc non breaking fixes
+- Quiet down eglot patch messages in case it's called from a hook
+
 ## 2022-11-12 0.3.0 Release Notes
 
 - Assigned copyright to Free Software Foundation (elpa requirement)
diff --git a/README.md b/README.md
index a5d789bf9d..ceee552e88 100644
--- a/README.md
+++ b/README.md
@@ -31,13 +31,6 @@ Load and initialize the repository
   (jarchive-setup))
 ```
 
-It can also be done in a hook (recommended)
-
-``` emacs-lisp
-(add-hook 'eglot-managed-mode-hook #'jarchive-setup)
-;; OR something like
-(add-hook 'clojure-mode-hook #'jarchive-setup)
-```
 or interactively, via `M-x jarchive-setup`.
 
 ## Working with Eglot
diff --git a/jarchive.el b/jarchive.el
index 34915e32d1..7fc807882f 100644
--- a/jarchive.el
+++ b/jarchive.el
@@ -3,7 +3,7 @@
 ;; Copyright (C) 2022 Free Software Foundation, Inc.
 ;; Authors: Danny Freeman <danny@dfreeman.email>
 ;; Maintainer: Danny Freeman <danny@dfreeman.email>>
-;; Version: 0.3.0
+;; Version: 0.4.0
 ;; Keywords: tools, languages, jvm, java, clojure
 ;; URL: https://git.sr.ht/~dannyfreeman/jarchive
 ;; Package-Requires: ((emacs "26.1"))
@@ -161,12 +161,12 @@ handle it. If it is not a jar call ORIGINAL-FN."
 (defun jarchive-patch-eglot ()
   "Patch old versions of Eglot to work with Jarchive."
   (interactive) ;; TODO, remove when eglot is updated in melpa
-  (cond
-   ((<= 29 emacs-major-version)
-    (message "[jarchive] Eglot does not need to be patched. Skipping."))
-   (t (advice-add 'eglot--path-to-uri :around 
#'jarchive--wrap-legacy-eglot--path-to-uri)
-      (advice-add 'eglot--uri-to-path :around 
#'jarchive--wrap-legacy-eglot--uri-to-path)
-      (message "[jarchive] Eglot successfully patched."))))
+  (unless (or (and (advice-member-p #'jarchive--wrap-legacy-eglot--path-to-uri 
'eglot--path-to-uri)
+                   (advice-member-p #'jarchive--wrap-legacy-eglot--uri-to-path 
'eglot--uri-to-path ))
+              (<= 29 emacs-major-version))
+    (advice-add 'eglot--path-to-uri :around 
#'jarchive--wrap-legacy-eglot--path-to-uri)
+    (advice-add 'eglot--uri-to-path :around 
#'jarchive--wrap-legacy-eglot--uri-to-path)
+    (message "[jarchive] Eglot successfully patched.")))
 
 ;;;###autoload
 (defun jarchive-setup ()



reply via email to

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